/* ─── Palette ────────────────────────────────────────────────────────────── */
:root {
    --bg:          #f2f3f5;
    --surface:     #ffffff;
    --navy:        #1b2a41;
    --navy-soft:   #2c3e58;
    --amber:       #c8882a;
    --amber-hover: #a86e1e;
    --text:        #1b2a41;
    --text-muted:  #6b7a8d;
    --border:      #dde1e7;
    --error-bg:    #fff4f4;
    --error-border:#e8b4b4;
    --error-text:  #8b2020;
}

/* ─── Reset / base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    background-color: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 2px 12px rgba(27, 42, 65, 0.07);
}

/* ─── Wordmark ───────────────────────────────────────────────────────────── */
.auth-wordmark {
    display: block;
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo",
                 monospace;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--navy);
    text-decoration: none;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.auth-wordmark span {
    color: var(--amber);
}

/* ─── Headings ───────────────────────────────────────────────────────────── */
.auth-heading {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--navy);
    margin: 0 0 0.35rem 0;
}

.auth-subheading {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 1.75rem 0;
    line-height: 1.5;
}

/* ─── Form ───────────────────────────────────────────────────────────────── */
.auth-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.auth-input {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
}

.auth-input:focus {
    border-color: var(--navy-soft);
    box-shadow: 0 0 0 3px rgba(44, 62, 88, 0.12);
}

.auth-input::placeholder {
    color: #b0bac6;
}

.auth-input.is-invalid {
    border-color: var(--error-border);
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(232, 180, 180, 0.3);
}

/* ─── Error state ────────────────────────────────────────────────────────── */
.auth-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 5px;
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
    color: var(--error-text);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.auth-error::before {
    content: "!";
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    background: var(--error-border);
    color: var(--error-text);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.05rem;
}

/* ─── Button ─────────────────────────────────────────────────────────────── */
.auth-btn {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    margin-top: 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--amber);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s ease;
    letter-spacing: 0.01em;
}

.auth-btn:hover {
    background: var(--amber-hover);
}

.auth-btn:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 2px;
    background: var(--amber-hover);
}

.auth-btn:active {
    transform: translateY(1px);
}

/* ─── Footer note ────────────────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    line-height: 1.5;
}

/* ─── Page footer ────────────────────────────────────────────────────────── */
.page-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}
