/*
 * Sign-in pages (login, forgot / reset / change password).
 * Basil pine + tomato: the colours of what Grinner's sells, and green is the
 * "pass" colour of a food-safety inspection. One family: Manrope.
 */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url(../fonts/manrope.woff2) format('woff2-variations');
}

:root {
    --pine: #1E4A38;
    --pine-deep: #163829;
    --pine-soft: #CFDDD4;
    --tomato: #C63D2B;
    --tomato-dark: #A83222;
    --page: #F2F5F1;
    --ink: #17211C;
    --muted: #56655D;
    --line: #C9D3CC;
    --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.auth {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

/* ---------------- Brand panel ---------------- */

.auth-brand {
    background: var(--pine);
    color: #fff;
    padding: 3.5rem 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Brand block sits level with the form; the footnote stays at the bottom */
.auth-brand-main { margin: auto 0; }

/* A single tomato rule under the wordmark: the one splash of red on the panel */
.auth-rule {
    display: block;
    width: 4.5rem;
    height: 6px;
    margin: 1.75rem 0 0;
    background: var(--tomato);
    border: 0;
    border-radius: 3px;
    opacity: 1;
}

.auth-wordmark {
    margin: 0;
    font-weight: 800;
    font-size: clamp(2.75rem, 4.8vw, 4.5rem);
    line-height: 1;
    letter-spacing: -0.03em;
}

.auth-wordmark span { display: block; }

.auth-wordmark .auth-wordmark-small {
    font-weight: 500;
    font-size: 0.34em;
    letter-spacing: 0;
    line-height: 1.1;
    margin-bottom: 0.35em;
    color: var(--pine-soft);
}

.auth-purpose {
    max-width: 30ch;
    margin: 1.5rem 0 0;
    font-size: 1.125rem;
    line-height: 1.45;
    color: var(--pine-soft);
}

.auth-brand-foot {
    margin: 0;
    font-size: 0.875rem;
    color: var(--pine-soft);
    opacity: 0.8;
}

/* ---------------- Form side ---------------- */

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.auth-form {
    width: 100%;
    max-width: 24rem;
}

.auth-title {
    margin: 0 0 0.35rem;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.auth-lead {
    margin: 0 0 2rem;
    color: var(--muted);
}

.auth-field { margin-bottom: 1.25rem; }

.auth-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.auth-field .auth-hint {
    margin-top: 0.4rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.auth-input {
    width: 100%;
    height: 3.25rem;
    padding: 0 1rem;
    font: inherit;
    font-size: 1.0625rem; /* >= 16px: no zoom-on-focus on iPhone */
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:hover { border-color: #AEBBB3; }

.auth-input:focus {
    outline: none;
    border-color: var(--pine);
    box-shadow: 0 0 0 3px rgba(30, 74, 56, 0.18);
}

.auth-password { position: relative; }

.auth-password .auth-input { padding-right: 4.75rem; }

.auth-reveal {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    padding: 0.35rem 0.6rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--pine);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.auth-reveal:hover { background: #E6EDE8; }

.auth-submit {
    width: 100%;
    height: 3.25rem;
    margin-top: 0.5rem;
    font: inherit;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #fff;
    background: var(--tomato);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.auth-submit:hover { background: var(--tomato-dark); }

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

.auth-links {
    margin-top: 1.5rem;
    font-size: 0.9375rem;
}

.auth-links a {
    color: var(--pine);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.auth-links a:hover { color: var(--pine-deep); text-decoration-thickness: 2px; }

.auth-reveal:focus-visible,
.auth-submit:focus-visible,
.auth-links a:focus-visible {
    outline: 3px solid var(--tomato);
    outline-offset: 3px;
}

/* Flash messages (Bootstrap alert markup from flashMessages()) */
.auth-form .alert {
    border-radius: 10px;
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

/* ---------------- Phones and narrow windows ---------------- */

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .auth-brand {
        padding: 1.75rem 1.5rem 1.6rem;
    }

    .auth-rule { width: 3.5rem; height: 5px; margin-top: 1rem; }

    .auth-wordmark { font-size: clamp(2.25rem, 10vw, 2.9rem); }

    .auth-purpose {
        margin-top: 0.75rem;
        font-size: 1rem;
        max-width: 40ch;
    }

    .auth-brand-foot { display: none; }

    .auth-main {
        align-items: flex-start;
        padding: 2rem 1.5rem 3rem;
    }

    .auth-title { font-size: 1.625rem; }
    .auth-lead { margin-bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-input, .auth-submit { transition: none; }
}
