﻿/* ======================================================
   RESET / BASE
====================================================== */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
    background: radial-gradient(circle at top left, #eef4ff 0%, transparent 28%), radial-gradient(circle at top right, #f4f7fb 0%, transparent 22%), #f3f5f8;
    color: #172033;
}

/* ======================================================
   TOP NAV
====================================================== */

.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(23, 32, 51, 0.94);
    backdrop-filter: blur(8px);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.topnav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
}
.topnav-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.topnav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

    .topnav-links a {
        color: #fff;
        text-decoration: none;
        padding: 8px 12px;
        border-radius: 10px;
        opacity: 0.95;
        transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
    }

        .topnav-links a:hover {
            opacity: 1;
            background: rgba(255,255,255,0.08);
            transform: translateY(-1px);
        }

/* ======================================================
   PAGE LAYOUT
====================================================== */

.app-main {
    padding: 18px;
}

.tree-page {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border-radius: 22px;
    padding: 18px 18px 22px 18px;
    box-shadow: 0 14px 40px rgba(16, 24, 40, 0.07), 0 2px 10px rgba(16, 24, 40, 0.04);
    min-height: calc(100vh - 108px);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.tree-page-header {
    margin-bottom: 14px;
}

    .tree-page-header h1 {
        margin: 0;
        font-size: 42px;
        line-height: 1.02;
        font-weight: 850;
        letter-spacing: -0.035em;
        color: #10213f;
    }

.tree-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.tree-page-main,
.tree-page-sidebar {
    min-width: 0;
}

.tree-page-sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
    display: grid;
    gap: 16px;
}

/* ======================================================
   RESPONSIVE
====================================================== */

@media (max-width: 900px) {
    .topnav {
        padding: 10px 14px;
    }

    .topnav-links a {
        padding: 7px 9px;
        font-size: 14px;
    }

    .app-main {
        padding: 12px;
    }

    .tree-page {
        border-radius: 16px;
        padding: 14px;
    }

    .tree-page-header h1 {
        font-size: 34px;
    }

    .tree-page-grid {
        grid-template-columns: 1fr;
    }

    .tree-page-sidebar {
        position: static;
        top: auto;
    }

    .topnav-user {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .topnav-user-meta {
        align-items: flex-start;
    }

    .auth-card {
        padding: 22px;
        border-radius: 18px;
    }

    .auth-card h1 {
        font-size: 28px;
    }
}
.topnav-links a.active {
    background: rgba(255,255,255,0.16);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
    opacity: 1;
}

.topnav-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
}

.topnav-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.topnav-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.topnav-user-code {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.68);
}

.topnav-user-form {
    margin: 0;
}

.topnav-logout {
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.topnav-logout:hover {
    background: rgba(255,255,255,0.14);
}

.auth-shell {
    display: flex;
    justify-content: center;
    padding: 28px 12px 42px;
}

.auth-card {
    width: min(100%, 520px);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
}

.auth-eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

.auth-card h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #10213f;
}

.auth-intro {
    margin: 0 0 20px;
    color: #526277;
    line-height: 1.6;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.auth-field input,
.auth-field select {
    width: 100%;
    border: 1px solid #d7e3f4;
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    color: #10213f;
    background: #fff;
}

.auth-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-height: 48px;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, #5b6f91 50%),
        linear-gradient(135deg, #5b6f91 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.auth-field input:focus,
.auth-field select:focus {
    outline: none;
    border-color: #9bb8f2;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.auth-submit {
    border: 0;
    background: #1d4ed8;
    color: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    margin-top: 6px;
}

.auth-submit:hover {
    background: #1e40af;
}

.auth-help,
.auth-account-meta {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5edf6;
    color: #475569;
    line-height: 1.6;
}

.auth-account-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-message {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    line-height: 1.5;
}

.auth-message ul {
    margin: 0;
    padding-left: 18px;
}

.auth-message-success {
    background: #dcfce7;
    color: #166534;
}

.auth-message-error {
    background: #fee2e2;
    color: #991b1b;
}

.auth-field-error {
    font-size: 12px;
    color: #b91c1c;
}
