/*
 * Auth pages (login, password reset) — standalone, matches the grandesescolhas.com
 * design system: Inter + Playfair Display, brand red, 2px radius, light only.
 * Not built by Mix; served as-is through versioned_asset(). Fonts and tokens live in ge-tokens.css.
 */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--stone-700);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 200ms;
}

a:hover {
    color: var(--brand-dark);
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Shell ---------- */

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

@media (min-width: 960px) {
    .auth {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        grid-template-rows: none;
    }
}

/* ---------- Wine panel ---------- */

.auth-panel {
    position: relative;
    overflow: hidden;
    background: var(--brand-dark);
    color: var(--gold-soft);
}

.auth-panel__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 16px;
}

@media (min-width: 960px) {
    .auth-panel__inner {
        padding: 48px 56px;
    }
}

.auth-panel__logo {
    display: block;
    align-self: flex-start;
    height: 32px;
    width: auto;
    animation: auth-fade 400ms ease-out both;
}

@media (min-width: 960px) {
    .auth-panel__logo {
        height: 40px;
    }
}

/* The glass: fine gold lines; a red stream pours in and the bowl fills. Desktop only. */
.auth-glass {
    display: none;
}

@media (min-width: 960px) {
    .auth-glass {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: center;
        min-height: 0;
        padding: 40px 0;
    }
}

.auth-glass svg {
    display: block;
    height: min(58vh, 540px);
    width: auto;
    overflow: visible;
}

.auth-glass__lines {
    stroke: var(--accent);
    stroke-width: 1.25;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.auth-glass__shine {
    opacity: 0.45;
}

.auth-glass__stream {
    stroke: var(--brand);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 1 1;
    stroke-dashoffset: -1;
    animation: auth-pour-stream 1700ms linear 200ms both;
}

.auth-glass__wine {
    fill: var(--brand);
    animation: auth-fill 1150ms var(--pour) 500ms both;
}

/* Once full, the surface keeps a slow ripple: two wave layers drift one wavelength (40 units) and loop. */
.auth-glass__wave--back {
    fill: #c0393d;
    animation: auth-ripple 5200ms linear 1650ms infinite reverse;
}

.auth-glass__wave--front {
    fill: var(--brand);
    animation: auth-ripple 3600ms linear 1650ms infinite;
}

.auth-panel__copy {
    display: none;
}

@media (min-width: 960px) {
    .auth-panel__copy {
        display: block;
        max-width: 26rem;
    }
}

.auth-panel__rule {
    display: block;
    width: 64px;
    height: 1px;
    background: var(--accent);
    transform-origin: 0 50%;
    animation: auth-draw 500ms var(--rise) 1500ms both;
}

.auth-panel__headline {
    margin: 28px 0 0;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2.75rem, 4.2vw, 4rem);
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--white);
    animation: auth-rise 600ms var(--rise) 1600ms both;
}

.auth-panel__text {
    margin: 24px 0 0;
    max-width: 22rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gold-soft);
    animation: auth-rise 600ms var(--rise) 1700ms both;
}

/* ---------- Form column ---------- */

.auth-main {
    display: flex;
    flex-direction: column;
    padding: 40px 16px 24px;
}

@media (min-width: 640px) {
    .auth-main {
        padding: 64px 40px 32px;
    }
}

.auth-main__body {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    animation: auth-rise 280ms var(--rise) 150ms both;
}

@media (min-width: 960px) {
    .auth-main__body {
        margin: auto;
    }
}

.auth-main__footer {
    width: 100%;
    max-width: 28rem;
    margin: 48px auto 0;
    font-size: 0.875rem;
    color: var(--stone-600);
}

@media (min-width: 960px) {
    .auth-main__footer {
        margin-top: 0;
    }
}

.auth-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--stone-600);
}

.auth-eyebrow::before {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--accent);
}

.auth-title {
    margin: 16px 0 0;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 2.25rem;
    line-height: 1;
    color: var(--stone-900);
}

@media (min-width: 768px) {
    .auth-title {
        font-size: 3rem;
    }
}

.auth-lead {
    margin: 20px 0 0;
    font-size: 1rem;
    color: var(--stone-700);
}

/* ---------- Notices ---------- */

.auth-notice {
    margin: 24px 0 0;
    padding: 12px 16px;
    border: 1px solid;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.auth-notice--error {
    border-color: var(--red-700);
    background: var(--red-50);
    color: var(--red-900);
}

.auth-notice--success {
    border-color: var(--accent);
    background: var(--gold-soft);
    color: var(--stone-900);
}

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

.auth-form {
    margin-top: 32px;
}

.auth-field + .auth-field {
    margin-top: 20px;
}

.auth-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--stone-900);
}

.auth-control {
    position: relative;
    margin-top: 8px;
}

.auth-input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--stone-400);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--stone-900);
    font: inherit;
    font-size: 16px;
    transition: border-color 150ms;
}

.auth-input:hover {
    border-color: var(--stone-600);
}

.auth-input:focus {
    border-color: var(--brand);
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.auth-input[readonly] {
    background: var(--stone-50);
    color: var(--stone-600);
}

.auth-input[aria-invalid='true'] {
    border-color: var(--red-700);
}

.auth-control--password .auth-input {
    padding-right: 52px;
}

.auth-reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    display: none;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--stone-600);
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 150ms, background-color 150ms;
}

.js .auth-reveal {
    display: grid;
}

.auth-reveal:hover {
    color: var(--brand);
    background: rgba(165, 30, 34, 0.08);
}

.auth-reveal svg {
    width: 20px;
    height: 20px;
}

.auth-reveal .auth-reveal__hide,
.auth-reveal[aria-pressed='true'] .auth-reveal__show {
    display: none;
}

.auth-reveal[aria-pressed='true'] .auth-reveal__hide {
    display: block;
}

.auth-hint {
    margin: 8px 0 0;
    font-size: 0.875rem;
    color: var(--stone-600);
}

.auth-error {
    margin: 8px 0 0;
    font-size: 0.875rem;
    color: var(--red-900);
}

.auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: 20px;
    font-size: 0.875rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--stone-700);
    cursor: pointer;
}

.auth-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
}

.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: 32px;
    padding: 12px 20px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    color: var(--white);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 200ms;
}

.auth-button:hover {
    background: var(--brand-dark);
}

.auth-button:focus-visible {
    outline-offset: 4px;
}

.auth-back {
    display: inline-block;
    margin-top: 24px;
    font-size: 0.875rem;
}

/* ---------- Motion ---------- */

@keyframes auth-pour-stream {
    0% {
        stroke-dashoffset: 1;
    }
    25%,
    80% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -1;
    }
}

@keyframes auth-ripple {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-40px);
    }
}

@keyframes auth-fill {
    from {
        transform: translateY(96px);
    }
    to {
        transform: none;
    }
}

@keyframes auth-draw {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes auth-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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