/*
 * Admin sign-in pages (login, forgot password, reset password).
 * Layout: brand panel on the left, form on the right, copyright line at the foot of the form panel.
 * Brand colours come from the client: Wasabi green #CCD400 and Seaweed green #003F23.
 */
:root {
    --seaweed: #003F23;
    --seaweed-deep: #002A17;
    --wasabi: #CCD400;
    --ink: #0f2a1d;
    --muted: #586d60;
    --line: #c9d3cc;
    --danger: #b42318;
    --danger-bg: #fdecea;
    --paper: #ffffff;
    --auth-font: "Wasabi", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body.auth-body {
    margin: 0;
    font-family: var(--auth-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
}

.auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ---- brand panel ---- */
.auth-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--seaweed);
    color: #fff;
    overflow: hidden;
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--wasabi);
    opacity: 0.18;
    pointer-events: none;
}

.auth-brand::before { width: 520px; height: 520px; right: -190px; top: -190px; }
.auth-brand::after { width: 340px; height: 340px; left: -140px; bottom: -140px; }

.auth-wordmark {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 22rem;
}

.auth-wordmark { align-items: center; text-align: center; }

/* The whole brand block is a link to the log in page. */
.auth-wordmark { color: inherit; text-decoration: none; cursor: pointer; }
.auth-wordmark:focus-visible { outline: 3px solid var(--wasabi); outline-offset: 8px; border-radius: 8px; }

.auth-wordmark .emblem {
    display: block;
    width: clamp(170px, 18vw, 240px);
    height: auto;
}

.auth-wordmark .name {
    margin: 0;
    font-size: clamp(24px, 2.6vw, 34px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.auth-wordmark .tag {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--wasabi);
}

/* ---- form panel ---- */
.auth-panel {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    margin: auto;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--seaweed);
}

.auth-lead {
    margin: 0 0 28px;
    color: var(--muted);
}

.auth-field { margin-bottom: 18px; }

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.auth-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}

.auth-input::placeholder { color: #8a9a90; }

.auth-input:focus {
    outline: none;
    border-color: var(--seaweed);
    box-shadow: 0 0 0 3px rgba(204, 212, 0, 0.55);
}

.auth-input.input-validation-error { border-color: var(--danger); }

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }

.auth-password { position: relative; }
.auth-password .auth-input { padding-right: 46px; }

.eye-pass {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.eye-pass:hover { color: var(--seaweed); }
.eye-pass:focus-visible { outline: 2px solid var(--seaweed); outline-offset: 1px; }

.auth-error {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: var(--danger);
}

.auth-error:empty { display: none; }

/* Password requirements: only the ones not met yet are listed (reset password page). */
.pw-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin: 10px 0 0;
    padding: 12px 14px;
    list-style: none;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f6f9f7;
    font-size: 13px;
    color: var(--muted);
}

.pw-rules[hidden],
.pw-rules li[hidden] { display: none; }

.pw-rules li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pw-rules li::before {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
}

.pw-rules .pw-rule-wide { grid-column: 1 / -1; }

.auth-row {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 22px;
}

.auth-link {
    color: var(--seaweed);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-link:hover { color: var(--seaweed-deep); }

.auth-link:focus-visible {
    outline: 3px solid rgba(204, 212, 0, 0.7);
    outline-offset: 2px;
    border-radius: 2px;
}

.auth-alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 6px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 14px;
}

.auth-alert:empty { display: none; }

.auth-btn {
    display: block;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 6px;
    background: var(--seaweed);
    color: #fff;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.auth-btn:hover { background: var(--seaweed-deep); }
.auth-btn:focus-visible { outline: 3px solid var(--wasabi); outline-offset: 2px; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-back {
    margin: 22px 0 0;
    text-align: center;
    font-size: 15px;
}

.auth-footer {
    padding-top: 16px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
}

/* ---- narrow screens: brand panel becomes a band above the form ---- */
@media (max-width: 480px) {
    .pw-rules { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { padding: 28px 24px; }
    .auth-wordmark { flex-direction: row; align-items: center; text-align: left; gap: 16px; max-width: none; }
    .auth-wordmark .emblem { width: 64px; flex: none; }
    .auth-wordmark .name { font-size: 22px; }
    .auth-wordmark .name { min-width: 0; }
    .auth-wordmark .tag { display: none; }
    .auth-panel { min-height: 0; padding: 32px 20px 20px; }
    .auth-card { margin-block: 8px 24px; }
}
