/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #0d1117;
    --surface:  #161b22;
    --surface2: #21262d;
    --border:   #30363d;
    --primary:  #5b8dee;
    --primary-h:#4070d6;
    --text:     #e6edf3;
    --muted:    #7d8590;
    --green:    #3fb950;
    --red:      #f85149;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
header {
    padding: 18px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #5b8dee 0%, #a855f7 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-tag {
    font-size: 0.75rem;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 100px;
}

/* ── Main / Hero ── */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(91,141,238,.12);
    border: 1px solid rgba(91,141,238,.3);
    color: #5b8dee;
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 28px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.dot-live {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%,100% { opacity: 1; }
    50%      { opacity: .3; }
}

h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 18px;
    background: linear-gradient(160deg, #e6edf3 30%, #7d8590 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 460px;
    line-height: 1.7;
    margin-bottom: 44px;
}

/* ── Card ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    width: 100%;
    max-width: 460px;
    margin-bottom: 36px;
    text-align: left;
}

.input-group { margin-bottom: 14px; }

label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

input[type="text"] {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color .18s;
}

input[type="text"]:focus  { border-color: var(--primary); }
input[type="text"]::placeholder { color: var(--muted); }
input[type="text"].error  { border-color: var(--red); animation: shake .25s; }

@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}

/* ── Buttons ── */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 22px;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .18s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    margin-top: 6px;
}

.btn-primary:hover {
    background: var(--primary-h);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(91,141,238,.35);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Divider ── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Join row ── */
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; }
.join-row .btn {
    width: auto;
    white-space: nowrap;
    padding: 11px 18px;
    font-size: 0.85rem;
}

/* ── Features ── */
.features {
    display: flex;
    gap: 16px;
    max-width: 460px;
    width: 100%;
}

.feature {
    flex: 1;
    text-align: center;
    padding: 20px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.feature-icon { font-size: 1.5rem; margin-bottom: 8px; }
.feature h3   { font-size: 0.82rem; font-weight: 600; margin-bottom: 4px; }
.feature p    { font-size: 0.75rem; color: var(--muted); line-height: 1.5; }

/* ── Footer ── */
footer {
    padding: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
}

footer a { color: var(--primary); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Meet page ── */
body.page-meet {
    height: 100vh;       /* fixed height so flex children can fill space */
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    height: 52px;
}

.topbar-left  { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all .15s;
}

.back-link:hover {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface2);
}

.room-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text);
}

.room-dot {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

.topbar-logo {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
}

.btn-sm {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.btn-sm:hover       { border-color: var(--primary); color: var(--primary); }
.btn-sm.success     { border-color: var(--green); color: var(--green); }

#meet-wrap {
    flex: 1;
    min-height: 0;       /* crucial: allows flex child to shrink & fill */
    position: relative;
    overflow: hidden;
}

#jitsi-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.loading-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    gap: 16px;
    z-index: 10;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3px solid var(--surface2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen p { color: var(--muted); font-size: 0.88rem; }

/* ── Responsive ── */
@media (max-width: 580px) {
    header    { padding: 14px 16px; }
    .header-tag { display: none; }
    .card     { padding: 22px; }
    .features { flex-direction: column; }
    h1        { font-size: 2rem; }
    .subtitle { font-size: .95rem; }
}
