/* IELTS X — sign in / create account (assets/css/login.css). Colours come from the shared tokens in ix-unified.css, so
   the auth pages match the rest of the site in light and dark mode. Local names are prefixed --lg- to avoid clashes. */
:root, html.dark-mode {
    --lg-bg: hsl(var(--background)); --lg-card: hsl(var(--card)); --lg-fg: hsl(var(--foreground)); --lg-muted: hsl(var(--muted-foreground));
    --lg-line: hsl(var(--border)); --lg-line-strong: hsl(var(--ix-line-strong, 215 20% 75%));
    --lg-primary: hsl(var(--foreground)); --lg-primary-fg: hsl(var(--background));
    --lg-ring: hsl(var(--primary) / 0.35); --lg-danger: hsl(var(--destructive)); --lg-soft: hsl(var(--muted));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
    margin: 0; background: var(--lg-bg); color: var(--lg-fg); display: flex; flex-direction: column; min-height: 100vh;
    font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; }
.brand img { height: 32px; width: auto; display: block; }
/* the logo is red on transparent: it reads fine on dark, no inversion (inverting turned it into a white square) */
.btn-ghost { border: 1px solid var(--lg-line); border-radius: 8px; padding: 8px 14px; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--lg-fg); background: var(--lg-card); }
.btn-ghost:hover { background: var(--lg-soft); }

.stage { flex: 1; display: grid; place-items: center; padding: 8px 20px 24px; }
.card { width: 100%; max-width: 400px; background: var(--lg-card); border: 1px solid var(--lg-line); border-radius: 16px; padding: 28px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06); }
h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; }
.sub { margin: 6px 0 22px; color: var(--lg-muted); font-size: 14px; }

.eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lg-muted); }
.saved { margin-bottom: 18px; }
.saved-row { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.saved-pick {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; color: inherit;
    padding: 9px 12px; border: 1px solid var(--lg-line); border-radius: 10px; background: var(--lg-soft); font: inherit;
}
.saved-pick:hover { border-color: var(--lg-line-strong); }
.saved-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #1e293b; color: #fff; font-size: 12px; font-weight: 700; }
.saved-text { min-width: 0; line-height: 1.25; }
.saved-name { display: block; font-size: 13px; font-weight: 600; }
.saved-mail { display: block; font-size: 12px; color: var(--lg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-remove { flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--lg-muted); cursor: pointer; font-size: 18px; line-height: 1; }
.saved-remove:hover { background: var(--lg-soft); color: var(--lg-danger); }

.google-slot { display: flex; justify-content: center; min-height: 44px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--lg-muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--lg-line); }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
input {
    width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--lg-line-strong); border-radius: 10px; background: transparent; color: inherit; font: inherit; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--lg-muted); opacity: 0.7; }
input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px var(--lg-ring); }
input[aria-invalid="true"] { border-color: var(--lg-danger); }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); border: 0; background: transparent; color: var(--lg-muted); font-size: 12px; font-weight: 600; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.pw-toggle:hover { color: var(--lg-fg); background: var(--lg-soft); }

.error { min-height: 0; margin: 0 0 10px; color: var(--lg-danger); font-size: 13px; line-height: 1.35; }
.error:empty { display: none; }
.btn-primary {
    width: 100%; height: 46px; border: 0; border-radius: 10px; background: var(--lg-primary); color: var(--lg-primary-fg);
    font: inherit; font-weight: 600; cursor: pointer; transition: opacity 0.15s, transform 0.05s;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary:focus-visible, .btn-ghost:focus-visible, .saved-pick:focus-visible, .link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

.switch { margin: 18px 0 0; text-align: center; color: var(--lg-muted); font-size: 14px; }
.link { border: 0; background: none; padding: 0; color: var(--lg-fg); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.legal { text-align: center; padding: 0 20px 24px; color: var(--lg-muted); font-size: 12px; }
.legal a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 480px) {
    .card { padding: 22px 18px; border-radius: 14px; }
    .topbar { padding: 16px; }
}

.ok { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #dcfce7; color: #166534; font-size: 13px; line-height: 1.4; }
html.dark-mode .ok { background: #14301f; color: #86efac; }
.forgot { margin: 8px 0 0; text-align: right; font-size: 13px; }
.forgot .link { font-weight: 500; color: var(--lg-muted); }
a.btn-primary { display: block; }

.google-fallback{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;max-width:344px;height:44px;border:1px solid #dadce0;border-radius:4px;background:#fff;color:#3c4043;font:500 14px system-ui,sans-serif;cursor:pointer}
.google-fallback:hover{background:#f8f9fa}

/* server setup problems (shown only when /api/health reports them) */
.notice { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #f59e0b; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: 13px; line-height: 1.5; }
.notice strong { display: block; margin-bottom: 4px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
html.dark-mode .notice { background: #2a1d07; border-color: #b45309; color: #fcd34d; }
