﻿/* ==========================================================================
   ZenZonApp — glass surfaces
   Shared by the country gate (Register) and the US waitlist.

   Drop into wwwroot/css/ and link once in App.razor, after your existing
   stylesheet so these tokens win:

       <link rel="stylesheet" href="css/country-gate.css" />

   Retarget the six colour tokens below and every surface follows.
   ========================================================================== */

:root {
    /* Grounded in the blue already on your headings, not a new palette. */
    --gate-ink: #14183A;
    --gate-ink-soft: #4A5079;
    --gate-brand: #3B3FD8;
    --gate-brand-deep: #1E2185;
    --gate-sage: #6FA8A0;
    --gate-mist: #EEF1FC;
    --gate-glass: rgba(255, 255, 255, 0.58);
    --gate-glass-edge: rgba(255, 255, 255, 0.85);
    --gate-glass-shadow: 0 24px 60px -20px rgba(20, 24, 58, 0.35);
    --gate-radius: 20px;
}


/* --------------------------------------------------------------------------
   The scene

   backdrop-filter only renders something if there is variation behind the
   element. On the flat near-white page you have now, a frosted card is
   invisible. This gradient field is what the card actually blurs.
   -------------------------------------------------------------------------- */

.gate-scene {
    position: relative;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(1.25rem, 5vw, 3rem);
    background: var(--gate-mist);
    isolation: isolate;
    overflow: hidden;
}

    .gate-scene::before {
        content: "";
        position: absolute;
        inset: -25%;
        z-index: -1;
        filter: saturate(1.15);
        animation: gate-drift 48s ease-in-out infinite alternate;
    }

/* Slow enough to read as light rather than as an animation. */
@keyframes gate-drift {
    from {
        transform: translate3d(-2%, -1%, 0) scale(1);
    }

    to {
        transform: translate3d( 2%, 1%, 0) scale(1.06);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gate-scene::before {
        animation: none;
    }
}


/* --------------------------------------------------------------------------
   Modal scrim

   The country gate sits over the register form. This frosts whatever is
   behind it, and carries its own colour so it still reads as a surface when
   the page underneath is empty.
   -------------------------------------------------------------------------- */

.gate-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 5vw, 3rem);
    overflow-y: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

    /* A little more opaque than the default card: this one sits on a dark
   scrim and the label text needs to stay crisp. */
    .gate-modal .gate-card {
        background: rgba(255, 255, 255, 0.74);
    }


/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */

.gate-card {
    width: min(30rem, 100%);
    padding: clamp(1.75rem, 4vw, 2.75rem);
    border-radius: var(--gate-radius);
    background: var(--gate-glass);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid var(--gate-glass-edge);
    box-shadow: var(--gate-glass-shadow);
}

/* The waitlist carries two paragraphs of copy and needs the extra measure. */
.gate-card--wide {
    width: min(38rem, 100%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .gate-card {
        background: rgba(255, 255, 255, 0.93);
    }
}

.gate-card h1 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--gate-brand-deep);
}

.gate-card p {
    margin: 0 0 1rem;
    max-width: 62ch;
    line-height: 1.6;
    color: var(--gate-ink-soft);
}

    .gate-card p:last-of-type {
        margin-bottom: 1.75rem;
    }


/* --------------------------------------------------------------------------
   Fields

   Markup order matters: input first, label second. The label floats off
   :not(:placeholder-shown), so every input needs placeholder=" " even when
   it has no visible placeholder text.
   -------------------------------------------------------------------------- */

.gate-field {
    position: relative;
    margin-bottom: 1rem;
}

    .gate-field input,
    .gate-field select {
        width: 100%;
        padding: 1.6rem 0.95rem 0.6rem;
        font: inherit;
        font-size: 1rem;
        color: var(--gate-ink);
        /* background-color, never the shorthand: the shorthand resets
     background-repeat and background-position, which tiles the select's
     chevron across the whole field. */
        background-color: rgba(255, 255, 255, 0.55);
        border: 1px solid rgba(20, 24, 58, 0.14);
        border-radius: 12px;
        appearance: none;
        -webkit-appearance: none;
        transition: border-color 0.16s ease, background-color 0.16s ease;
    }

        .gate-field input:hover,
        .gate-field select:hover {
            border-color: rgba(20, 24, 58, 0.28);
        }

        .gate-field input:focus,
        .gate-field select:focus {
            border-color: var(--gate-brand);
            background-color: rgba(255, 255, 255, 0.78);
        }

    .gate-field label {
        position: absolute;
        left: 0.95rem;
        top: 0.95rem;
        font-size: 1rem;
        color: var(--gate-ink-soft);
        pointer-events: none;
        transform-origin: left top;
        transition: transform 0.16s ease, color 0.16s ease;
    }

    .gate-field input:focus ~ label,
    .gate-field input:not(:placeholder-shown) ~ label,
    .gate-field select:focus ~ label,
    .gate-field select ~ label {
        transform: translateY(-0.62rem) scale(0.75);
    }

    .gate-field input:focus ~ label,
    .gate-field select:focus ~ label {
        color: var(--gate-brand);
    }

    /* The overlap fix: the placeholder stays invisible until the label has
   moved out of its way. */
    .gate-field input::placeholder {
        color: transparent;
    }

    .gate-field input:focus::placeholder {
        color: rgba(74, 80, 121, 0.55);
    }

    /* appearance:none removes the native arrow, so draw one. */
    .gate-field select {
        padding-right: 2.75rem;
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' fill='none' stroke='%234A5079' stroke-width='2' stroke-linecap='round'/></svg>");
        background-repeat: no-repeat;
        background-position: right 1rem center;
    }

        .gate-field select:focus {
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' fill='none' stroke='%233B3FD8' stroke-width='2' stroke-linecap='round'/></svg>");
        }


/* --------------------------------------------------------------------------
   Button
   -------------------------------------------------------------------------- */

.gate-btn {
    width: 100%;
    padding: 0.9rem 1.25rem;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, var(--gate-brand), var(--gate-brand-deep));
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 10px 24px -10px rgba(30, 33, 133, 0.7);
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}

    .gate-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 28px -10px rgba(30, 33, 133, 0.75);
    }

    .gate-btn:active {
        transform: translateY(0);
    }

    .gate-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

@media (prefers-reduced-motion: reduce) {
    .gate-btn {
        transition: none;
    }

        .gate-btn:hover {
            transform: none;
        }
}


/* --------------------------------------------------------------------------
   Focus, validation, small screens
   -------------------------------------------------------------------------- */

.gate-card :is(input, select, button):focus-visible {
    outline: 2px solid var(--gate-brand);
    outline-offset: 2px;
}

.gate-error {
    margin: 0 0 1rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    color: #7A1024;
    background: rgba(255, 228, 233, 0.72);
    border: 1px solid rgba(122, 16, 36, 0.22);
    border-radius: 10px;
}

.gate-note {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--gate-ink-soft);
}

@media (max-width: 32rem) {
    .gate-scene {
        padding: 1rem;
        align-items: start;
        padding-top: 2.5rem;
    }

    .gate-card {
        border-radius: 16px;
    }
}
