/* Inheritable Trusted Advisor Portal — base styles.
   CSS variables are named to match the shared step-up modal helper
   (--surface-color, --text-color, --border-color, --accent-color, etc.)
   so the ported modal picks up the theme without changes. */

:root {
    --accent-color: #1a73e8;
    --accent-hover: #1666cf;
    --bg-color: #f4f6f9;
    --surface-color: #ffffff;
    --text-color: #14243b;
    --text-secondary-color: #5a6b82;
    --border-color: #dbe2ec;
    --input-bg-color: #ffffff;
    --danger-color: #dc3545;
    --sidebar-bg: #14243b;
    --sidebar-text: #cdd8e6;
    --sidebar-active: #ffffff;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(20, 36, 59, .08), 0 6px 20px rgba(20, 36, 59, .06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--accent-color); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--text-secondary-color); }

/* ── Brand ─────────────────────────────────────────────────────────── */
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand.center { align-items: center; text-align: center; margin-bottom: 24px; }
.brand-mark { font-weight: 700; font-size: 20px; letter-spacing: -.2px; }
.brand-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; opacity: .75; }

/* ── App shell (authenticated) ─────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 24px 18px;
    flex-shrink: 0;
}
.sidebar .brand { color: #fff; margin-bottom: 28px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    color: var(--sidebar-text);
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 500;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.nav-item.active { background: rgba(255, 255, 255, .12); color: var(--sidebar-active); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}
.page-title { font-size: 20px; font-weight: 600; margin: 0; }
.account { display: flex; align-items: center; gap: 16px; }
.account-text { display: flex; flex-direction: column; text-align: right; line-height: 1.25; }
.account-name { font-weight: 600; font-size: 14px; }
.account-firm { font-size: 12px; color: var(--text-secondary-color); }
.signout {
    font-size: 13px; font-weight: 500;
    padding: 8px 14px; border: 1px solid var(--border-color);
    border-radius: 8px; color: var(--text-color);
}
.signout:hover { background: #eef1f6; text-decoration: none; }

.content { padding: 28px; }

/* ── Panels / clients ──────────────────────────────────────────────── */
.panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    max-width: 900px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { font-size: 17px; margin: 0; }
.empty-state { padding: 24px 0; }
.empty-state p { margin: 0 0 8px 0; }

.clients { list-style: none; margin: 0; padding: 0; }
.client-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 4px; border-bottom: 1px solid var(--border-color);
}
.client-row:last-child { border-bottom: none; }
.client-name { font-weight: 600; }
.client-meta { color: var(--text-secondary-color); font-size: 13px; }

/* ── Auth pages ────────────────────────────────────────────────────── */
.auth-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 24px;
    background: linear-gradient(160deg, #14243b 0%, #22405f 100%);
}
.auth-card-wrap { width: 100%; max-width: 420px; }
.auth-card {
    background: var(--surface-color);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
    padding: 32px 30px;
}
.auth-title { font-size: 22px; font-weight: 700; margin: 0 0 6px 0; }
.auth-sub { font-size: 14px; color: var(--text-secondary-color); margin: 0 0 20px 0; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-secondary-color); }
.field-input {
    font-size: 15px; padding: 11px 13px;
    border: 1px solid var(--border-color); border-radius: 9px;
    background: var(--input-bg-color); color: var(--text-color);
}
.field-input:focus { outline: 2px solid var(--accent-color); outline-offset: 1px; border-color: var(--accent-color); }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary-color); user-select: none; }
.checkbox input { width: 16px; height: 16px; }

.btn-primary {
    font-size: 15px; font-weight: 600;
    padding: 12px 16px; border: none; border-radius: 9px;
    background: var(--accent-color); color: #fff; cursor: pointer;
    margin-top: 4px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.auth-error { color: var(--danger-color); font-size: 13px; min-height: 18px; }
.auth-notice {
    background: #eaf1fd; color: #1a3d6e;
    border: 1px solid #c9defb; border-radius: 8px;
    padding: 10px 12px; font-size: 13px;
}
.auth-links { margin-top: 18px; font-size: 13px; text-align: center; }
