/*
 * Main-domain gateway (Client Access) and error pages. Self-contained (does not need site.css).
 * Same brand language as the three websites: navy, warm white, champagne gold, Playfair Display and Poppins.
 */
@font-face {
    font-family: "Playfair Display";
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url("../fonts/playfair-display-latin-var.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/poppins-latin-400.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/poppins-latin-500.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/poppins-latin-600.woff2") format("woff2");
}

:root {
    --gw-navy: #0e1a2b;
    --gw-navy-2: #16273f;
    --gw-night: #0a0f17;
    --gw-gold: #c4a46c;
    --gw-gold-light: #dcc497;
    --gw-gold-ink: #7a6038;
    --gw-ivory: #f8f5ef;
    --gw-ink: #131821;
    --gw-text: #3a4351;
    --gw-muted: #5f6877;
    --gw-line: #e2dacb;
    --gw-field: #d6cebf;
    --gw-danger: #a3232b;
    --gw-focus: #2563eb;
    --gw-radius: 6px;
    --font-serif: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

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

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

body.gateway {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--gw-text);
    background-color: var(--gw-navy);
    background-image:
        radial-gradient(90% 60% at 100% 0%, rgba(196, 164, 108, .08), transparent 60%),
        radial-gradient(ellipse at 50% -10%, var(--gw-navy-2) 0%, var(--gw-navy) 65%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:focus-visible { outline: 3px solid var(--gw-focus); outline-offset: 3px; }

.gw-main { min-height: 100vh; min-height: 100dvh; }

/* ------------------------------------------------------------------ Layout: brand panel + access card */
.gw-layout { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.gw-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    min-height: 15rem;
    padding: 2.25rem 1.25rem 4.75rem;
    color: #fff;
}

.gw-hero__media { position: absolute; inset: 0; z-index: -1; }

.gw-hero__img { display: block; width: 100%; height: 100%; object-fit: cover; }

.gw-hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 15, 23, .55) 0%, rgba(14, 26, 43, .86) 60%, var(--gw-navy) 100%);
}

.gw-hero__content { width: 100%; max-width: 27rem; margin: 0 auto; display: flex; align-items: center; gap: 1rem; }

.gw-hero__mark {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 3.6rem;
    height: 3.6rem;
    border: 1px solid rgba(196, 164, 108, .65);
    border-radius: var(--gw-radius);
    background: rgba(10, 15, 23, .45);
    color: #fff;
}

.gw-hero__mark .brand-icon { width: 1.95rem; height: 1.95rem; }

.gw-hero__name { display: flex; flex-direction: column; margin: 0; line-height: 1.15; }

.gw-hero__firm { font-family: var(--font-serif); font-size: 1.45rem; font-weight: 600; letter-spacing: .01em; }

.gw-hero__sub {
    margin-top: .3rem;
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--gw-gold-light);
}

.gw-hero__rule { display: none; }

.gw-layout > .gw-shell {
    position: relative;
    width: 100%;
    max-width: 29rem;
    margin: -3.5rem auto 0;
    padding: 0 1rem 1.5rem;
}

@media (min-width: 64rem) {
    .gw-layout { flex-direction: row; }

    .gw-hero {
        flex: 1 1 50%;
        align-items: center;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 4rem;
    }

    .gw-hero__media::after {
        background:
            linear-gradient(90deg, rgba(10, 15, 23, .55) 0%, rgba(14, 26, 43, .78) 100%),
            linear-gradient(180deg, rgba(10, 15, 23, .2), rgba(10, 15, 23, .6));
    }

    .gw-hero__content { flex-direction: column; align-items: flex-start; gap: 1.75rem; max-width: 30rem; margin: 0 0 0 auto; padding-right: 2rem; }
    .gw-hero__mark { width: 5rem; height: 5rem; }
    .gw-hero__mark .brand-icon { width: 2.75rem; height: 2.75rem; }
    .gw-hero__firm { font-size: 2.6rem; }
    .gw-hero__sub { font-size: .82rem; margin-top: .55rem; }
    .gw-hero__rule { display: block; width: 4.5rem; height: 3px; background: var(--gw-gold); }

    .gw-layout > .gw-shell {
        flex: 1 1 50%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-width: none;
        margin: 0;
        padding: 3rem clamp(2rem, 5vw, 5rem);
        background: var(--gw-ivory);
    }

    .gw-layout > .gw-shell > * { width: 100%; max-width: 29rem; }
    .gw-layout .gw-card { box-shadow: 0 30px 70px -40px rgba(14, 26, 43, .5); }
    .gw-layout .gw-footer { color: var(--gw-muted); }
    .gw-layout .gw-footer a { color: var(--gw-gold-ink); }
}

/* Error pages: a single centred card. */
.gw-main > .gw-shell { width: 100%; max-width: 29rem; margin: 0 auto; padding: 2.5rem 1rem 1.5rem; }

/* ------------------------------------------------------------------ Brand (error pages) */
.gw-brand { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-bottom: 1.5rem; color: #fff; }

.gw-brand__mark {
    display: inline-grid;
    place-items: center;
    width: 3.6rem; height: 3.6rem;
    border: 1px solid rgba(196, 164, 108, .65);
    border-radius: var(--gw-radius);
    color: #fff;
}

.gw-brand__mark .brand-icon { width: 1.95rem; height: 1.95rem; }

.gw-brand__name { margin: 0; font-family: var(--font-serif); font-size: 1.45rem; font-weight: 600; }

/* ------------------------------------------------------------------ Card */
.gw-card {
    padding: 1.9rem 1.4rem 1.7rem;
    background: #fff;
    border-top: 3px solid var(--gw-gold);
    border-radius: var(--gw-radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.gw-card--center { text-align: center; }

.gw-title { margin: 0 0 .4rem; font-family: var(--font-serif); font-size: 1.85rem; font-weight: 600; line-height: 1.2; color: var(--gw-ink); }

.gw-intro { margin: 0 0 1.5rem; color: var(--gw-muted); font-size: .93rem; }

.gw-code { margin: 0 0 .25rem; font-family: var(--font-serif); font-size: 3rem; color: var(--gw-gold); line-height: 1; }

/* ------------------------------------------------------------------ Forms */
.gw-form { display: grid; gap: 1rem; }

.gw-field { display: grid; gap: .35rem; }

.gw-form label { font-size: .88rem; font-weight: 500; color: var(--gw-ink); }

.gw-form input {
    width: 100%;
    min-height: 3rem;
    padding: .65rem .85rem;
    border: 1px solid var(--gw-field);
    border-radius: 4px;
    background: #fff;
    color: var(--gw-ink);
    font: inherit;
    font-size: 1rem; /* 16px: no iOS zoom on focus */
    transition: border-color .2s ease, box-shadow .2s ease;
}

.gw-form input:focus { border-color: var(--gw-gold); outline: none; box-shadow: 0 0 0 4px rgba(196, 164, 108, .25); }

.gw-form input[aria-invalid="true"] { border-color: var(--gw-danger); }

.gw-alert {
    margin: 0;
    padding: .8rem .95rem;
    border: 1px solid #f0c2c5;
    border-left: 4px solid var(--gw-danger);
    border-radius: 4px;
    background: #fdf2f2;
    color: var(--gw-danger);
    font-size: .9rem;
}

.gw-alert[hidden] { display: none; }

.gw-field-error { margin: 0; color: var(--gw-danger); font-size: .88rem; }

.gw-input-group { display: flex; gap: .5rem; }
.gw-input-group input { flex: 1; min-width: 0; }

.gw-hint { margin: .5rem 0 0; color: var(--gw-muted); font-size: .88rem; }

/* ------------------------------------------------------------------ Buttons */
.gw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 3rem;
    padding: .65rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.gw-btn[hidden] { display: none; }
.gw-btn:disabled { opacity: .7; cursor: progress; }

.gw-btn--primary { background: var(--gw-navy); color: #fff; }
.gw-btn--primary:hover { background: var(--gw-ink); }

.gw-btn--outline { padding: .65rem .8rem; border-color: var(--gw-field); background: #fff; color: var(--gw-ink); text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 500; white-space: nowrap; }
.gw-btn--outline svg { color: var(--gw-gold-ink); }
.gw-btn--outline:hover { border-color: var(--gw-gold); background: var(--gw-ivory); }

.gw-btn--text { background: none; color: var(--gw-navy-2); text-decoration: underline; text-transform: none; letter-spacing: 0; min-height: 2.5rem; }

.gw-btn--block { width: 100%; }

.gw-card--center .gw-btn { margin-top: .5rem; }

/* ------------------------------------------------------------------ Divider */
.gw-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.6rem 0 1.15rem;
    color: var(--gw-muted);
    font-size: .74rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.gw-divider::before, .gw-divider::after { content: ""; flex: 1; height: 1px; background: var(--gw-line); }

/* ------------------------------------------------------------------ QR scanner */
.gw-qr { margin-bottom: 1.2rem; }

.gw-qr__buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .55rem; }

.gw-qr__panel { margin-top: .75rem; text-align: center; }
.gw-qr__panel[hidden] { display: none; }

.gw-qr__viewport {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: var(--gw-radius);
    background: #000;
}

.gw-qr__viewport video { display: block; width: 100%; height: 100%; object-fit: cover; }

.gw-qr__frame {
    position: absolute;
    inset: 18%;
    border: 2px solid var(--gw-gold-light);
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .4);
    pointer-events: none;
}

.gw-qr__status { min-height: 1.2em; margin: .6rem 0 0; color: var(--gw-muted); font-size: .88rem; }
.gw-qr__status:empty { display: none; }

/* ------------------------------------------------------------------ Footer */
.gw-footer { margin-top: 1.4rem; text-align: center; color: rgba(255, 255, 255, .72); font-size: .86rem; }
.gw-footer p { margin: .3rem 0; }
.gw-footer svg { vertical-align: -3px; margin-right: .2rem; }
.gw-footer a { color: var(--gw-gold-light); }

@media (min-width: 30rem) {
    .gw-card { padding: 2.3rem 2.1rem 2rem; }
}

@media (prefers-reduced-motion: no-preference) {
    .gw-card { animation: gw-rise .7s cubic-bezier(.2, .7, .2, 1) both; }
    .gw-hero__content { animation: gw-fade 1s ease both; }
}

@keyframes gw-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes gw-fade { from { opacity: 0; } }

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