/* ==============================================
   GATEWAY — PRIVATE ACCESS PAGE
   ============================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-deep: #08090b;
    --bg-graphite: #0e1014;
    --bg-card: rgba(20, 22, 28, 0.72);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text-primary: #f3f4f6;
    --text-secondary: #a8acb5;
    --text-muted: #6b6f78;
    --accent-gold: #c9a96a;
    --accent-platinum: #d8d4cc;
    --accent-navy: #1a2f5c;
    --error: #c8543c;
    --success: #6ba17a;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* ----------- Shell ----------- */
.gateway-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(201, 169, 106, 0.08), transparent 60%),
        radial-gradient(900px 500px at 0% 100%, rgba(26, 47, 92, 0.18), transparent 65%),
        linear-gradient(180deg, #08090b 0%, #0b0d11 50%, #08090b 100%);
    isolation: isolate;
}

.gateway-grid-bg {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

.gateway-noise {
    position: absolute; inset: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
    z-index: 0;
}

/* ----------- Top bar ----------- */
.gateway-top {
    position: relative; z-index: 2;
    display: flex; justify-content: space-between; align-items: center;
    padding: clamp(20px, 3vw, 36px) clamp(20px, 5vw, 60px);
    border-bottom: 1px solid var(--line);
}

.brand-mark { display: flex; align-items: center; gap: 14px; }
.brand-monogram {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px; font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 1px;
}
.brand-divider { width: 1px; height: 18px; background: var(--line-strong); }
.brand-meta {
    font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--text-muted);
}

.gateway-status { display: flex; align-items: center; gap: 10px; }
.status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(107, 161, 122, 0.6);
    animation: pulse 2.4s infinite;
}
.status-label {
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-secondary);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(107, 161, 122, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(107, 161, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(107, 161, 122, 0); }
}

/* ----------- Main ----------- */
.gateway-main {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    padding: clamp(30px, 6vw, 80px) clamp(20px, 5vw, 60px);
}

.gateway-card {
    position: relative;
    width: 100%; max-width: 560px;
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: clamp(32px, 5vw, 56px);
    box-shadow:
        0 30px 80px rgba(0,0,0,0.55),
        0 1px 0 rgba(255,255,255,0.04) inset;
    animation: cardRise 0.9s cubic-bezier(.2,.8,.2,1) both;
}

.gateway-card::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 4px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(201,169,106,0.4), transparent 30%, transparent 70%, rgba(201,169,106,0.25));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes cardRise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-eyebrow {
    display: flex; align-items: center; gap: 12px;
    font-size: 10px; letter-spacing: 3px; text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 28px;
}
.card-eyebrow .line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.card-eyebrow .line:last-child { background: linear-gradient(90deg, var(--line-strong), transparent); }
.card-eyebrow .line:first-child { background: linear-gradient(90deg, transparent, var(--line-strong)); }

.gateway-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 14px;
}
.gateway-title .serif {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-style: italic;
    color: var(--accent-platinum);
}

.gateway-subtitle {
    text-align: center;
    font-size: 13px; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.gateway-context {
    text-align: center;
    font-size: 14px; line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 36px;
    padding: 0 8px;
}
.gateway-context strong { color: var(--text-primary); font-weight: 500; }

/* ----------- Form ----------- */
.gateway-form { display: flex; flex-direction: column; gap: 14px; }

.input-wrap {
    position: relative;
    display: flex; align-items: center;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(.2,.8,.2,1);
}
.input-wrap:focus-within {
    border-color: var(--accent-gold);
    background: rgba(201,169,106,0.04);
    box-shadow: 0 0 0 4px rgba(201,169,106,0.08);
}
.input-wrap.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
.input-wrap.error { border-color: var(--error); background: rgba(200,84,60,0.04); }

@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

.input-wrap input {
    flex: 1;
    background: transparent;
    border: none; outline: none;
    padding: 18px 22px;
    font-family: inherit;
    font-size: 15px; letter-spacing: 0.5px;
    color: var(--text-primary);
    font-weight: 400;
}
.input-wrap input::placeholder { color: var(--text-muted); letter-spacing: 0.3px; }

.reveal-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted);
    padding: 0 18px; height: 100%;
    transition: color 0.25s ease;
}
.reveal-btn:hover { color: var(--accent-gold); }

.gateway-submit {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #c9a96a 0%, #b08e4f 100%);
    color: #0a0a0a;
    border: none; border-radius: 2px;
    padding: 18px 28px;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(.2,.8,.2,1);
    position: relative;
    overflow: hidden;
}
.gateway-submit::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #d4b876 0%, #c9a96a 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.gateway-submit:hover::before { opacity: 1; }
.gateway-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(201,169,106,0.18); }
.gateway-submit > * { position: relative; z-index: 1; }

.error-msg {
    text-align: center;
    font-size: 12px; letter-spacing: 1px;
    color: var(--error);
    opacity: 0;
    height: 0;
    transition: opacity 0.35s ease;
}
.error-msg.visible { opacity: 1; height: auto; }

/* ----------- Footer Tiles ----------- */
.card-footer {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.footer-tile { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.tile-label {
    font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-muted);
}
.tile-value {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ----------- Bottom ----------- */
.gateway-bottom {
    position: relative; z-index: 2;
    display: flex; justify-content: center; align-items: center;
    gap: 12px; flex-wrap: wrap;
    padding: 24px clamp(20px, 5vw, 60px);
    border-top: 1px solid var(--line);
    font-size: 11px; letter-spacing: 1px;
    color: var(--text-muted);
}
.dot-sep { color: var(--accent-gold); }

/* ----------- Responsive ----------- */
@media (max-width: 600px) {
    .card-footer { grid-template-columns: 1fr; gap: 12px; }
    .footer-tile { flex-direction: row; justify-content: space-between; text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); }
    .footer-tile:last-child { border-bottom: none; }
    .gateway-top { padding: 16px 20px; }
    .brand-meta { display: none; }
}

/* ----------- Success Transition ----------- */
.gateway-shell.exit { animation: shellExit 0.7s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes shellExit {
    to { opacity: 0; transform: scale(1.02); }
}
