:root {
    /* White, near-black ink, caramel gold accent */
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f8f6f3;
    --line: #e6e1da;
    --ink: #212529;
    --muted: #6c757d;
    --accent: #c3935b;
    --accent-hover: #ac7a3f;
    --accent-ink: #ffffff;
    --danger: #dc3545;
    --ok: #28a745;
    --radius: 14px;
    --shadow: 0 8px 28px rgba(33, 37, 41, .07);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: radial-gradient(1200px 600px at 80% -10%, #f6f1ea 0%, var(--bg) 55%);
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 650;
    letter-spacing: .2px;
}

.brand .dot {
    width: 26px; height: 26px; border-radius: 50%;
    background: conic-gradient(from 200deg, #c3935b, #ac7a3f, #8f5f2e, #d8b98d, #c3935b);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
}

.brand small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

.topbar .who { color: var(--muted); font-size: 14px; display: flex; gap: 14px; align-items: center; }

/* ── Language selector (topbar / floating on login) ─────────────────────── */
.lang-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.lang-seg button {
    background: transparent; color: var(--muted); border-radius: 0;
    font-size: 12px; font-weight: 600; letter-spacing: .6px; padding: 5px 11px;
    border-right: 1px solid var(--line);
}
.lang-seg button:last-child { border-right: none; }
.lang-seg button:hover { color: var(--ink); }
.lang-seg button.on { background: var(--accent); color: var(--accent-ink); }
.lang-seg select {
    display: none;              /* phones only — swapped in at 640px */
    width: auto;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--ink);
    font-size: 16px;            /* ≥16px so iOS doesn't zoom on focus */
    font-weight: 600;
    letter-spacing: .6px;
    padding: 5px 6px;
}
.lang-float { position: fixed; top: 18px; right: 20px; z-index: 5; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.card h2 { margin: 0 0 4px; font-size: 18px; }
.card .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

input, select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 15px;
    outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

button {
    cursor: pointer;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 16px;
    transition: transform .04s ease, filter .15s ease;
}
button:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--accent-ink); width: 100%; margin-top: 22px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.err { color: var(--danger); font-size: 14px; min-height: 18px; margin-top: 10px; }

@media (max-width: 640px) {
    body { overflow-x: hidden; }

    .topbar { padding: 12px 14px; gap: 10px; }
    .brand small { display: none; }
    .topbar .who { font-size: 13px; gap: 8px; }
    /* pills → compact native dropdown, and keep long usernames from pushing it off-screen */
    .lang-seg button { display: none; }
    .lang-seg select { display: block; }
    #who { max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar .btn-ghost { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
}
/* very narrow phones: the sign-out button matters more than the username */
@media (max-width: 400px) {
    #who { display: none; }

    .wrap { padding: 16px 12px 48px; }
    .card { padding: 16px 14px; }
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: 100%; max-width: 380px; }
