* { box-sizing: border-box; }

:root {
    --navy: #071f4f;
    --navy-2: #0b3b8f;
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --white: #fff;
    --bg: #f8fafc;
    --danger: #b42318;
    --success: #16803c;
}

html, body { margin: 0; min-height: 100%; }
body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

button, input { font: inherit; }

a { color: inherit; text-decoration: none; }

.portal-body {
    min-height: 100vh;
    min-height: 100svh;
    background:
        radial-gradient(circle at 10% 10%, rgba(37,99,235,.20), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(11,59,143,.24), transparent 35%),
        linear-gradient(135deg, #061633, #0b3b8f);
}

.portal-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: var(--portal-bg);
    background-size: cover;
    background-position: center;
    opacity: .16;
    pointer-events: none;
}

.portal-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    padding: 24px;
    display: grid;
    place-items: center;
}

.hero-card {
    width: min(1180px, 100%);
    min-height: min(760px, calc(100vh - 48px));
    min-height: min(760px, calc(100svh - 48px));
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 30px;
    background: rgba(255,255,255,.075);
    backdrop-filter: blur(20px);
    box-shadow: 0 35px 90px rgba(0,0,0,.30);
    color: #fff;
    display: flex;
    flex-direction: column;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 30%, rgba(96,165,250,.30), transparent 28%),
        radial-gradient(circle at 20% 80%, rgba(37,99,235,.28), transparent 28%);
    pointer-events: none;
}

.topbar, .portal-footer, .hero-content {
    position: relative;
    z-index: 2;
}

.topbar {
    padding: 26px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-weight: 750;
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255,255,255,.94);
    padding: 5px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    color: var(--navy);
    font-weight: 900;
}

.brand-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.13);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
}

.live-badge span, .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}

.hero-content {
    width: min(680px, 100%);
    margin: auto 0;
    padding: 60px;
}

.eyebrow, .connection-kicker {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
}

.hero-content h1 {
    margin: 12px 0 16px;
    font-size: clamp(46px, 7vw, 84px);
    line-height: .98;
    letter-spacing: -.055em;
}

.hero-copy {
    max-width: 590px;
    margin: 0;
    color: rgba(255,255,255,.78);
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.65;
}

.actions { margin-top: 34px; }

.btn {
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: .01em;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 16px 30px rgba(0,0,0,.20);
}

.btn-primary svg { width: 20px; fill: currentColor; }

.btn-secondary {
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 28px;
    color: rgba(255,255,255,.56);
    font-size: 13px;
}

.portal-footer {
    margin-top: auto;
    padding: 22px 30px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: rgba(255,255,255,.55);
    font-size: 12px;
}

.portal-footer a {
    color: rgba(255,255,255,.78);
    transition: color .2s ease;
}
.portal-footer a:hover { color: #fff; }

/* Meeting */
.meeting-body { background: #030b1b; }

.meeting-app {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: #030b1b;
}

.meeting-header {
    height: 68px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: rgba(3,11,27,.96);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.brand-dark .brand-name { color: #fff; }
.brand-dark img { width: 38px; height: 38px; }

.meeting-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255,255,255,.70);
    font-size: 12px;
    font-weight: 700;
}

.meeting-status.status-ready .status-dot { background: #22c55e; }
.meeting-status.status-error .status-dot { background: #ef4444; }

.header-back {
    color: rgba(255,255,255,.65);
    font-size: 13px;
}
.header-back:hover { color: #fff; }

.meeting-stage {
    min-height: 0;
    position: relative;
    background: #020617;
}

.connection-screen, .error-screen {
    height: 100%;
    min-height: 500px;
    padding: 40px 24px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    color: #fff;
}

.connection-screen h1, .error-screen h1 {
    margin: 8px 0 10px;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -.035em;
}

.connection-screen p:not(.connection-kicker),
.error-screen p:not(.connection-kicker) {
    max-width: 580px;
    margin: 0;
    color: rgba(255,255,255,.60);
    line-height: 1.65;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin .9s linear infinite;
    margin-bottom: 24px;
}

.connection-progress {
    width: min(280px, 70vw);
    height: 4px;
    margin-top: 26px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255,255,255,.08);
}
.connection-progress span {
    display: block;
    width: 35%;
    height: 100%;
    background: #3b82f6;
    border-radius: inherit;
    animation: progress 1.5s ease-in-out infinite;
}

.meeting-frame-wrap {
    position: absolute;
    inset: 0;
    background: #000;
}
.meeting-frame-wrap iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: 0;
    display: block;
}

.error-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 50%;
    background: rgba(239,68,68,.14);
    color: #fca5a5;
    font-weight: 900;
    font-size: 24px;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.meeting-footer {
    height: 40px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255,255,255,.35);
    font-size: 11px;
    background: #030b1b;
}

/* Admin */
.admin-body {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 10%, rgba(37,99,235,.15), transparent 30%),
        #f8fafc;
}

.admin-shell {
    width: min(460px, 100%);
    position: relative;
}

.admin-back {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 13px;
}

.admin-card {
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 25px 70px rgba(15,23,42,.10);
}

.admin-logo img, .admin-logo .brand-mark {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
    background: var(--blue-light);
    padding: 7px;
    margin-bottom: 22px;
}

.admin-card h1 {
    margin: 6px 0 8px;
    font-size: 32px;
    letter-spacing: -.035em;
}

.admin-copy {
    margin: 0 0 26px;
    color: var(--muted);
}

.admin-form { display: grid; gap: 10px; }
.admin-form label {
    font-size: 13px;
    font-weight: 750;
}

.password-field {
    position: relative;
    margin-bottom: 8px;
}
.password-field input {
    width: 100%;
    height: 52px;
    padding: 0 72px 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: #fff;
}
.password-field input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.btn-full { width: 100%; margin-top: 4px; }

.alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
}

[hidden] { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progress {
    0% { transform: translateX(-130%); }
    100% { transform: translateX(400%); }
}

@media (max-width: 700px) {
    .portal-shell { padding: 12px; }
    .hero-card {
        min-height: calc(100svh - 24px);
        border-radius: 22px;
    }
    .topbar { padding: 20px; }
    .brand-name { max-width: 180px; }
    .live-badge { display: none; }
    .hero-content {
        padding: 40px 24px;
        margin: auto 0;
    }
    .hero-content h1 { font-size: clamp(48px, 16vw, 72px); }
    .portal-footer { padding: 20px; }
    .meeting-header { padding: 0 14px; height: 60px; }
    .meeting-header .brand-name { display: none; }
    .meeting-stage { min-height: calc(100svh - 100px); }
    .meeting-frame-wrap iframe { min-height: calc(100svh - 100px); }
    .meeting-footer { padding: 0 12px; }
    .admin-card { padding: 28px 22px; }
}
