:root {
    --brand: #30577f;          /* GC logo blue */
    --brand-strong: #24476b;
    --brand-soft: #e7eef6;
    --ink: #1f2733;
    --ink-soft: #54606f;
    --card: #ffffff;
    --line: #dfe5ec;
    --field: #ffffff;
    --overlay: rgba(238, 242, 247, 0.82);
    --success: #1e7a4c;
    --success-soft: #e3f4ea;
    --warning: #9a5b00;
    --warning-soft: #fdf1dc;
    --error: #b42335;
    --error-soft: #fbe7e9;
    --shadow: 0 18px 48px rgba(31, 39, 51, 0.16), 0 2px 6px rgba(31, 39, 51, 0.08);
    --radius: 16px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand: #7fa8d6;
        --brand-strong: #a3c2e6;
        --brand-soft: #1f2d3d;
        --ink: #e8edf3;
        --ink-soft: #a6b2c0;
        --card: #161d26;
        --line: #2b3542;
        --field: #0f151c;
        --overlay: rgba(10, 14, 20, 0.84);
        --success: #5cc98f;
        --success-soft: #15291f;
        --warning: #f0b45a;
        --warning-soft: #2c2214;
        --error: #f07a88;
        --error-soft: #2e171b;
        --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: linear-gradient(var(--overlay), var(--overlay)), url("../img/bg.jpg") center / cover fixed, #dfe7f1;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 32px 16px;
}

/* Header */
.brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink);
    text-decoration: none;
}
.brand-link img { width: 56px; height: 56px; }
.brand-link strong { display: block; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-link small { display: block; color: var(--ink-soft); font-size: 0.92rem; }

/* Card */
.card {
    width: 100%;
    max-width: 480px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 36px 32px;
}
@media (max-width: 480px) {
    .card { padding: 28px 20px 24px; }
}

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.01em; }
p { margin: 0 0 14px; }
.lead { color: var(--ink-soft); font-size: 1.04rem; margin-bottom: 24px; }
.muted { color: var(--ink-soft); }
.note { color: var(--ink-soft); font-size: 0.94rem; margin: 22px 0 0; text-align: center; }
code { font-size: 0.85em; }

.back {
    display: inline-block;
    margin: -12px 0 14px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
}
.back:hover { color: var(--brand); }

/* Home choices */
.choices { display: grid; gap: 12px; }
.choice {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.choice:hover, .choice:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
    transform: translateY(-1px);
    outline: none;
}
.choice-icon {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-soft);
    display: grid;
    place-items: center;
}
.choice-icon svg, .result-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: var(--brand);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.choice-text { flex: 1; }
.choice-text strong { display: block; font-size: 1.05rem; }
.choice-text small { color: var(--ink-soft); font-size: 0.92rem; }
.chevron { font-size: 1.8rem; color: var(--ink-soft); line-height: 1; }
.chevron.external { font-size: 1.2rem; }

/* Forms */
.form { display: flex; flex-direction: column; }
label { font-weight: 600; font-size: 0.95rem; margin: 14px 0 6px; }
label:first-of-type { margin-top: 0; }
input[type=text], input[type=password], input:not([type]) {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
input.input-validation-error { border-color: var(--error); }
.hint { color: var(--ink-soft); font-size: 0.85rem; margin-top: 4px; }
.field-error { color: var(--error); font-size: 0.88rem; }
.field-error:empty { display: none; }
.field-error:not(:empty) { margin-top: 4px; }

.password-field { position: relative; }
.password-field input { padding-right: 72px; }
.reveal {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand);
    background: none;
    border: 0;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
}
.reveal:hover, .reveal:focus-visible { background: var(--brand-soft); outline: none; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 10px;
    padding: 13px 20px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
@media (prefers-color-scheme: dark) {
    .button { color: #0f151c; }
}
.button:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.button.secondary { color: var(--brand); background: transparent; }
.button.secondary:hover { background: var(--brand-soft); }
.button.busy { opacity: 0.7; cursor: progress; }
.button.busy::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.actions .button { margin-top: 12px; }

/* Messages */
.alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}
.alert strong { display: block; }
.alert.error { background: var(--error-soft); color: var(--error); }
.alert.error.validation-summary-valid { display: none; }
.alert ul { margin: 0; padding-left: 18px; }

.rules {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--brand-soft);
    font-size: 0.9rem;
}
.rules p { margin: 0 0 6px; font-weight: 600; }
.rules ul { margin: 0; padding: 0; list-style: none; }
.rules li { position: relative; padding-left: 22px; margin: 4px 0; color: var(--ink-soft); }
.rules li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.6em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-soft);
    opacity: 0.6;
}
.rules li.ok { color: var(--success); }
.rules li.ok::before { content: "\2713"; background: none; opacity: 1; top: 0; left: 2px; width: auto; height: auto; font-weight: 700; }
.rules li.bad { color: var(--ink); }

/* Result screens */
.result { text-align: center; }
.result .lead { margin-bottom: 14px; }
.result p:not(.lead) { color: var(--ink-soft); }
.result-icon {
    width: 72px;
    height: 72px;
    margin: 4px auto 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}
.result-icon svg { width: 36px; height: 36px; stroke-width: 2.5; }
.result.success .result-icon { background: var(--success-soft); box-shadow: 0 0 0 8px var(--success-soft); }
.result.success .result-icon svg { stroke: var(--success); }
.result.warning .result-icon { background: var(--warning-soft); box-shadow: 0 0 0 8px var(--warning-soft); }
.result.warning .result-icon svg { stroke: var(--warning); }

/* Footer */
.footer { text-align: center; color: var(--ink-soft); font-size: 0.92rem; max-width: 480px; }
.footer p { margin: 0 0 4px; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
