@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Staging Portal — Gate + Toolbar */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --rl-bg-start: #1a1a2e;
    --rl-bg-end: #16213e;
    --rl-surface: rgba(255,255,255,0.05);
    --rl-surface-border: rgba(255,255,255,0.1);
    --rl-input-bg: rgba(255,255,255,0.05);
    --rl-input-border: rgba(255,255,255,0.2);
    --rl-input-focus: rgba(255,255,255,0.1);
    --rl-accent: #4f46e5;
    --rl-accent-hover: #4338ca;
    --rl-text: #fff;
    --rl-text-muted: rgba(255,255,255,0.6);
    --rl-text-dim: rgba(255,255,255,0.4);
    --rl-error-bg: rgba(239,68,68,0.2);
    --rl-error-border: rgba(239,68,68,0.4);
    --rl-error-text: #fca5a5;
    --rl-info-bg: rgba(59,130,246,0.2);
    --rl-info-border: rgba(59,130,246,0.4);
    --rl-info-text: #93c5fd;
    --rl-toolbar-bg: #1d1d1f;
    --rl-toolbar-btn-bg: #333;
    --rl-toolbar-btn-hover: #555;
    --rl-badge-bg: #f59e0b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--rl-bg-start) 0%, var(--rl-bg-end) 100%);
    min-height: 100vh;
    color: var(--rl-text);
}

/* ── Gate Page ── */
.container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    flex-direction: column;
    padding: 24px;
}
.container > * {
    background: var(--rl-surface);
    border: 1px solid var(--rl-surface-border);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(10px);
}

h1 { font-size: 24px; margin-bottom: 8px; text-align: center; }
.subtitle { color: var(--rl-text-muted); text-align: center; margin-bottom: 32px; font-size: 14px; }
.site-name { background: rgba(255,255,255,0.1); padding: 16px; border-radius: 8px; margin-bottom: 24px; text-align: center; }
.site-name strong { font-size: 18px; display: block; margin-bottom: 4px; }
.site-name span { color: var(--rl-text-muted); font-size: 14px; }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; color: rgba(255,255,255,0.8); font-size: 14px; }
input[type="password"] {
    width: 100%; padding: 14px 16px; border: 1px solid var(--rl-input-border);
    border-radius: 8px; background: var(--rl-input-bg); color: var(--rl-text); font-size: 16px;
    transition: border-color 0.2s, background 0.2s;
}
input[type="password"]:focus { outline: none; border-color: var(--rl-accent); background: var(--rl-input-focus); }
button {
    width: 100%; padding: 16px; background: var(--rl-accent); border: none;
    border-radius: 8px; color: var(--rl-text); font-size: 16px; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
}
button:hover { background: var(--rl-accent-hover); }
button:active { transform: scale(0.98); }

.error {
    background: var(--rl-error-bg); border: 1px solid var(--rl-error-border);
    color: var(--rl-error-text); padding: 12px; border-radius: 8px;
    margin-bottom: 20px; text-align: center; font-size: 14px; line-height: 1.5;
}
.info {
    background: var(--rl-info-bg); border: 1px solid var(--rl-info-border);
    color: var(--rl-info-text); padding: 12px; border-radius: 8px;
    margin-bottom: 20px; text-align: center; font-size: 14px;
}
.rapidlaunch { text-align: center; margin-top: 24px; color: var(--rl-text-dim); font-size: 12px; }
.rapidlaunch a { color: var(--rl-text-muted); text-decoration: none; transition: color 0.2s; }
.rapidlaunch a:hover { color: var(--rl-text); }
.landing { text-align: center; }
.landing-logo { margin-bottom: 20px; display: flex; justify-content: center; }
.landing-logo svg { filter: drop-shadow(0 4px 12px rgba(23,97,122,0.3)); }
.landing h1 { margin-bottom: 16px; }
.landing p { color: var(--rl-text-muted); line-height: 1.6; font-size: 14px; }

/* ── Iframe View Toolbar ── */
.toolbar {
    display: flex; gap: 12px; padding: 10px 16px; background: var(--rl-toolbar-bg);
    color: var(--rl-text); align-items: center; font-size: 13px; flex-wrap: wrap;
    min-height: 46px; position: sticky; top: 0; z-index: 10;
}
.toolbar strong { white-space: nowrap; }
.toolbar-subtitle { color: #86868b; font-size: 12px; flex-shrink: 0; }
.toolbar-badge {
    background: var(--rl-badge-bg); color: #000; padding: 2px 10px;
    border-radius: 10px; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.toolbar-spacer { flex: 1; min-width: 12px; }
.toolbar a,
.toolbar button {
    color: var(--rl-text); background: var(--rl-toolbar-btn-bg); border: none;
    padding: 6px 14px; border-radius: 6px; cursor: pointer; text-decoration: none;
    font-size: 13px; transition: background 0.15s; white-space: nowrap;
}
.toolbar a:hover,
.toolbar button:hover { background: var(--rl-toolbar-btn-hover); }
.toolbar a:focus-visible,
.toolbar button:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 2px; }

.expiry-warning {
    width: 100%; padding: 6px 12px; background: var(--rl-badge-bg); color: #000;
    text-align: center; font-size: 13px; font-weight: 600; order: -1; margin: -2px -8px 6px -8px;
}
.expiry-warning a { color: #000; text-decoration: underline; background: none; padding: 0; }
.expiry-warning a:hover { color: #333; background: none; }

.ext-icon { font-size: 11px; opacity: 0.6; margin-left: 2px; }

.iframe-wrap { flex: 1; overflow: hidden; background: var(--rl-bg-start); }
.iframe-wrap iframe { width: 100%; height: calc(100vh - 46px); border: none; display: block; }

body:has(.toolbar) { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* Focus rings */
.toolbar a:focus-visible,
.toolbar button:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 2px; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 2px; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .container > * { padding: 32px 24px; border-radius: 12px; }
    h1 { font-size: 20px; }
    .toolbar { gap: 8px; padding: 8px 12px; font-size: 12px; }
    .toolbar a,
    .toolbar button { padding: 5px 10px; font-size: 12px; }
    .toolbar-subtitle { display: none; }
}
