/* Auth — Verdant grocery; loads after storefront.css for variables */

:root {
    --auth-green: #00c45f;
    --auth-green-dark: #003d33;
    --auth-green-mid: #0a5c4a;
    --auth-surface: #f6faf8;
    --auth-card: #ffffff;
    --auth-border: #e2ebe7;
    --auth-muted: #5a726b;
    --auth-shadow: 0 4px 6px -1px rgb(2 51 41 / 0.06), 0 24px 48px -12px rgb(2 51 41 / 0.12);
}

body.sf-auth-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--sf-font-sans, 'DM Sans', system-ui, sans-serif);
    font-size: 1rem;
    line-height: 1.62;
    color: var(--auth-green-dark);
    background: var(--auth-surface);
    -webkit-font-smoothing: antialiased;
}

/* ——— Layout ——— */
.sf-auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 960px) {
    html.sf-auth-html {
        height: 100%;
        overflow: hidden;
    }

    html.sf-auth-html body.sf-auth-body {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .sf-auth-page {
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        min-height: 0;
        overflow: hidden;
        grid-template-columns: minmax(280px, 38%) 1fr;
        grid-template-rows: 1fr;
        align-items: stretch;
    }
}

/* ——— Brand column ——— */
.sf-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.75rem 1.5rem 2rem;
    background: linear-gradient(165deg, #022c24 0%, var(--auth-green-dark) 42%, #011f1a 100%);
    color: #fff;
    overflow: hidden;
}

@media (min-width: 960px) {
    .sf-auth-brand {
        min-height: 0;
        height: 100%;
        max-height: 100%;
        padding: 1.25rem 1.75rem 1.1rem;
        justify-content: center;
        gap: 1rem;
        overflow: hidden;
    }

    .sf-auth-brand__logo {
        margin-bottom: 0.75rem;
    }

    .sf-auth-brand__logo img {
        max-height: 36px !important;
    }

    .sf-auth-brand__lead {
        font-size: 0.9375rem;
        line-height: 1.45;
        max-width: 19rem;
    }

    .sf-auth-brand__foot {
        margin-top: auto;
        padding-top: 0.5rem;
    }
}

.sf-auth-brand__bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 18% 22%, rgb(0 196 95 / 0.18) 0%, transparent 42%),
        radial-gradient(circle at 88% 78%, rgb(0 196 95 / 0.12) 0%, transparent 38%),
        radial-gradient(circle at 50% 100%, rgb(0 0 0 / 0.2) 0%, transparent 55%);
    pointer-events: none;
}

.sf-auth-brand__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23fff'/%3E%3C/svg%3E");
    background-size: 28px 28px;
}

.sf-auth-brand__content {
    position: relative;
    z-index: 1;
}

.sf-auth-brand__logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    margin-bottom: 1.75rem;
}

.sf-auth-brand__logo img {
    max-height: 42px;
    width: auto;
    object-fit: contain;
    filter: brightness(1.05);
}

.sf-auth-brand__wordmark {
    font-family: var(--sf-font-display, Georgia, serif);
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.sf-auth-brand__dot {
    color: var(--auth-green);
}

.sf-auth-brand__lead {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: rgb(255 255 255 / 0.88);
    max-width: 22rem;
    font-weight: 500;
}

.sf-auth-brand__foot {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgb(255 255 255 / 0.12);
}

@media (max-width: 959px) {
    .sf-auth-brand__foot .sf-auth-locale {
        display: none;
    }
}

.sf-auth-brand__link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-green);
    text-decoration: none;
    transition: color 0.15s ease;
}

.sf-auth-brand__link:hover {
    color: #fff;
}

.sf-auth-locale {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sf-auth-locale form {
    display: inline;
    margin: 0;
}

.sf-auth-locale button {
    min-width: 2.25rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgb(255 255 255 / 0.25);
    background: rgb(255 255 255 / 0.06);
    color: #fff;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.sf-auth-locale button:hover {
    background: rgb(255 255 255 / 0.12);
    border-color: rgb(255 255 255 / 0.4);
}

.sf-auth-locale button.is-active {
    background: var(--auth-green);
    border-color: var(--auth-green);
    color: #fff;
}

/* ——— Main column ——— */
.sf-auth-main {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.25rem 1rem 2.5rem;
}

@media (min-width: 960px) {
    .sf-auth-main {
        align-items: center;
        justify-content: center;
        min-height: 0;
        height: 100%;
        padding: 0.75rem 1.25rem;
        overflow: hidden;
    }

    .sf-auth-card {
        padding: 1.1rem 1.35rem 0.85rem;
    }

    .sf-auth-card::before {
        margin: -1.1rem -1.35rem 0.85rem;
        height: 2px;
    }

    .sf-auth-card__head {
        margin-bottom: 0.65rem;
    }

    .sf-auth-card__title {
        font-size: 1.4rem;
        margin-bottom: 0.25rem;
    }

    .sf-auth-card__sub {
        font-size: 0.8125rem;
        line-height: 1.4;
    }

    .sf-auth-hint {
        margin-bottom: 0.65rem;
        padding: 0.5rem 0.65rem;
        font-size: 0.75rem;
    }

    .sf-auth-alert {
        margin-bottom: 0.65rem;
        padding: 0.55rem 0.75rem;
        font-size: 0.8125rem;
    }

    .sf-auth-field {
        margin-bottom: 0.6rem;
    }

    .sf-auth-field label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .sf-auth-input {
        padding: 0.5rem 0.8rem;
        font-size: 0.9375rem;
        border-radius: 10px;
    }

    .sf-auth-check {
        margin-bottom: 0.65rem;
        font-size: 0.8125rem;
    }

    .sf-auth-btn {
        padding: 0.62rem 1rem;
        font-size: 0.9375rem;
        border-radius: 10px;
    }

    .sf-auth-switch {
        margin: 0.85rem 0 0;
        font-size: 0.8125rem;
    }

    .sf-auth-foot {
        margin-top: 0.65rem;
        padding-top: 0.65rem;
        font-size: 0.6875rem;
    }

    /* Register: two-column rows on desktop, tighter gaps */
    .sf-auth-page--register .sf-auth-field-grid--register-row,
    .sf-auth-page--register .sf-auth-field-grid--passwords {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
        margin-bottom: 0.45rem;
    }

    .sf-auth-page--register .sf-auth-field-grid--register-row > .sf-auth-field,
    .sf-auth-page--register .sf-auth-field-grid--passwords > .sf-auth-field {
        margin-bottom: 0;
    }

    .sf-auth-page--register .sf-auth-check {
        margin-bottom: 0.5rem;
        line-height: 1.35;
    }
}

/* Register name+email row: stack on small screens */
@media (max-width: 959px) {
    .sf-auth-field-grid--register-row {
        display: grid;
        gap: 1rem;
        grid-template-columns: 1fr;
    }

    .sf-auth-field-grid--register-row > .sf-auth-field {
        margin-bottom: 0;
    }
}

.sf-auth-shell {
    width: 100%;
    max-width: 440px;
}

.sf-auth-shell--wide {
    max-width: 540px;
}

.sf-auth-card--wide {
    max-width: none;
}

.sf-auth-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

@media (min-width: 960px) {
    .sf-auth-mobile-bar {
        display: none;
    }
}

.sf-auth-mobile-bar__logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--auth-green-dark);
    font-family: var(--sf-font-display, Georgia, serif);
    font-weight: 700;
    font-size: 1.25rem;
}

.sf-auth-mobile-bar__logo span {
    color: var(--auth-green);
}

.sf-auth-mobile-bar__logo img {
    max-height: 32px;
    width: auto;
}

.sf-auth-locale--light button {
    border-color: var(--auth-border);
    background: #fff;
    color: var(--auth-muted);
}

.sf-auth-locale--light button:hover {
    border-color: var(--auth-green);
    color: var(--auth-green-dark);
}

.sf-auth-locale--light button.is-active {
    background: var(--auth-green-dark);
    border-color: var(--auth-green-dark);
    color: #fff;
}

/* ——— Card ——— */
.sf-auth-card {
    width: 100%;
    background: var(--auth-card);
    border-radius: 20px;
    border: 1px solid var(--auth-border);
    box-shadow: var(--auth-shadow);
    padding: 1.75rem 1.5rem 1.5rem;
    box-sizing: border-box;
}

@media (min-width: 480px) {
    .sf-auth-card {
        padding: 2rem 2rem 1.75rem;
    }
}

.sf-auth-card::before {
    content: '';
    display: block;
    height: 3px;
    margin: -1.75rem -1.5rem 1.5rem;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, var(--auth-green) 0%, var(--auth-green-mid) 100%);
}

@media (min-width: 480px) {
    .sf-auth-card::before {
        margin: -2rem -2rem 1.75rem;
    }
}

.sf-auth-card__head {
    margin-bottom: 1.35rem;
}

.sf-auth-card__title {
    font-family: var(--sf-font-display, Georgia, serif);
    font-size: 1.625rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--auth-green-dark);
    letter-spacing: -0.02em;
}

.sf-auth-card__sub {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--auth-muted);
}

.sf-auth-hint {
    margin: 0 0 1.25rem;
    padding: 0.75rem 0.9rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--auth-muted);
    background: var(--auth-surface);
    border-radius: 10px;
    border: 1px solid var(--auth-border);
}

/* ——— Alerts ——— */
.sf-auth-alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 1.15rem;
    line-height: 1.45;
}

.sf-auth-alert--error {
    background: #fff8f8;
    border: 1px solid #f0d4d4;
    color: #6b2c2c;
}

.sf-auth-alert--success {
    background: #f0fdf6;
    border: 1px solid #b8e8cc;
    color: var(--auth-green-dark);
}

/* ——— Form ——— */
.sf-auth-form {
    margin-top: 0.25rem;
}

.sf-auth-field {
    margin-bottom: 1.15rem;
}

.sf-auth-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-green-dark);
    margin-bottom: 0.4rem;
}

.sf-auth-field__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.sf-auth-field__row label {
    margin-bottom: 0;
}

.sf-auth-field__link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-green);
    text-decoration: none;
    white-space: nowrap;
}

.sf-auth-field__link:hover {
    color: var(--auth-green-dark);
    text-decoration: underline;
}

.sf-auth-input {
    width: 100%;
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    font: inherit;
    font-size: 1rem;
    color: var(--auth-green-dark);
    background: #fafcfb;
    box-sizing: border-box;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.sf-auth-input:hover {
    border-color: #c5d9d0;
    background: #fff;
}

.sf-auth-input:focus {
    outline: none;
    border-color: var(--auth-green);
    background: #fff;
    box-shadow: 0 0 0 3px rgb(0 196 95 / 0.18);
}

.sf-auth-input::placeholder {
    color: var(--auth-muted);
    opacity: 0.65;
}

.sf-auth-field-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 520px) {
    .sf-auth-field-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.sf-auth-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1.2rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--auth-muted);
}

.sf-auth-check input {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.12rem;
    accent-color: var(--auth-green);
    flex-shrink: 0;
    border-radius: 4px;
}

.sf-auth-check a {
    color: var(--auth-green);
    font-weight: 600;
    text-decoration: none;
}

.sf-auth-check a:hover {
    text-decoration: underline;
    color: var(--auth-green-dark);
}

.sf-auth-btn {
    display: block;
    width: 100%;
    padding: 0.8rem 1.25rem;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition:
        transform 0.12s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.sf-auth-btn--primary {
    background: linear-gradient(180deg, #00d668 0%, var(--auth-green) 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgb(0 196 95 / 0.25);
}

.sf-auth-btn--primary:hover {
    background: linear-gradient(180deg, #00e06e 0%, #00b354 100%);
    box-shadow: 0 4px 12px rgb(0 196 95 / 0.35);
    transform: translateY(-1px);
}

.sf-auth-btn--primary:active {
    transform: translateY(0);
}

/* ——— Footer links ——— */
.sf-auth-switch {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--auth-muted);
}

.sf-auth-switch a {
    font-weight: 600;
    color: var(--auth-green);
    text-decoration: none;
    margin-left: 0.25rem;
}

.sf-auth-switch a:hover {
    color: var(--auth-green-dark);
    text-decoration: underline;
}

.sf-auth-foot {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-border);
    text-align: center;
    font-size: 0.75rem;
    color: var(--auth-muted);
}
