:root {
    color-scheme: light;
    --bg: #f7f7f8;
    --surface: #ffffff;
    --text: #050505;
    --muted: #5f6368;
    --line: #eceef3;
    --primary: #5143c6;
    --primary-dark: #3e34a3;
    --accent: #8bc8e3;
    --accent-dark: #5eafd3;
    --danger: #c93535;
    --shadow: 0 18px 42px rgba(20, 22, 36, 0.08);
    --shadow-soft: 0 8px 24px rgba(20, 22, 36, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Roboto, Arial, sans-serif;
    font-size: 16px;
}

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

a:hover {
    text-decoration: underline;
}

.topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar.event-only {
    justify-content: flex-end;
    min-height: 58px;
}

.brand {
    color: var(--text);
    font-weight: 900;
}

.nav {
    display: flex;
    gap: 10px;
}

.nav a {
    border-radius: 10px;
    color: var(--text);
    font-weight: 700;
    padding: 9px 12px;
}

.nav a:hover {
    background: #f0f1f8;
    text-decoration: none;
}

.topbar.event-only .nav a {
    background: var(--primary);
    color: #fff;
    min-width: 82px;
    text-align: center;
}

.topbar.event-only .nav a:hover {
    background: var(--primary-dark);
}

.page {
    margin: 0 auto;
    max-width: 1280px;
    min-height: calc(100vh - 112px);
    padding: 32px;
}

.footer {
    color: var(--muted);
    font-size: 14px;
    padding: 24px 32px;
    text-align: center;
}

.hero {
    align-items: center;
    display: grid;
    min-height: 68vh;
}

.hero h1,
.panel h1,
.dash-header h1,
.welcome-line h1 {
    margin: 0 0 12px;
}

.hero h1 {
    font-size: clamp(42px, 7vw, 82px);
    line-height: 0.96;
    max-width: 760px;
}

.hero p {
    color: var(--muted);
    font-size: 20px;
    line-height: 1.55;
    max-width: 680px;
}

.eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.button {
    align-items: center;
    background: var(--primary);
    border: 0;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 900;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
}

.button:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.button.secondary {
    background: #f0f1f8;
    color: var(--text);
}

.button.danger {
    background: var(--danger);
}

.button.small {
    font-size: 14px;
    min-height: 36px;
    padding: 0 12px;
}

.panel,
.module,
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

.panel.narrow {
    margin: 48px auto;
    max-width: 520px;
}

.form {
    display: grid;
    gap: 16px;
}

.form.compact {
    gap: 10px;
}

label {
    color: var(--text);
    display: grid;
    font-weight: 700;
    gap: 7px;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(81, 67, 198, 0.12);
    outline: 0;
}

select {
    appearance: auto;
}

.conditional-field[hidden] {
    display: none;
}

textarea {
    resize: vertical;
}

.checkbox {
    align-items: center;
    display: flex;
    font-weight: 600;
}

.checkbox input {
    min-height: auto;
    width: auto;
}

.alert,
.inline-status {
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 11px 12px;
}

.inline-status {
    margin: 0;
    min-height: 20px;
    padding: 0;
}

.alert.success,
.inline-status.ok {
    color: #0c7a53;
}

.alert.error,
.inline-status.bad {
    color: var(--danger);
}

.alert.debug {
    background: #fff6d8;
    color: #7a5800;
}

.muted,
small {
    color: var(--muted);
}

.event-dashboard {
    display: grid;
    gap: 22px;
}

.event-banner,
.event-footer-image {
    background: var(--surface);
    border: 0;
    border-radius: 0;
    display: block;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.event-banner img,
.event-footer-image img {
    display: block;
    height: auto;
    width: 100%;
}

.event-banner {
    aspect-ratio: 16 / 3;
}

.event-banner img {
    height: 100%;
    object-fit: cover;
}

.event-footer-image {
    aspect-ratio: 16 / 2;
}

.event-footer-image img {
    height: 100%;
    object-fit: cover;
}

.event-header {
    align-items: center;
    background: var(--surface);
    border-left: 8px solid var(--primary);
    border-radius: 0 16px 16px 0;
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 22px 26px;
}

.event-header h1 {
    margin: 0 0 8px;
}

.event-header p {
    margin: 0;
}

.event-greeting {
    color: var(--text);
    font-size: clamp(19px, 2.4vw, 28px);
    font-weight: 900;
    line-height: 1.28;
}

.event-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 390px;
}

.video-area {
    min-width: 0;
}

.video-frame {
    aspect-ratio: 16 / 9;
    background: #0d1422;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.video-frame iframe {
    border: 0;
    height: 100%;
    width: 100%;
}

.social-banner {
    align-items: center;
    background: var(--accent);
    border: 0;
    border-radius: 0;
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 18px 20px;
}

.social-banner strong {
    display: block;
    font-size: 22px;
    font-weight: 900;
}

.social-banner span {
    color: rgba(5, 5, 5, 0.66);
    display: block;
    margin-top: 2px;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.social-links a {
    background: var(--primary);
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-weight: 900;
    min-height: 38px;
    padding: 9px 12px;
}

.social-links a:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.side-panel {
    display: grid;
    gap: 18px;
    align-content: start;
}

.module {
    padding: 22px;
}

.questions-module {
    margin-top: 18px;
}

.module-title {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.module h2,
.panel h2 {
    font-size: 20px;
    margin: 0 0 16px;
}

.module-title h2 {
    align-items: center;
    display: flex;
    font-weight: 900;
    gap: 10px;
    margin-bottom: 12px;
}

.module-title h2::before {
    background: var(--primary);
    content: "";
    display: inline-block;
    height: 32px;
    width: 6px;
}

.live-list {
    max-height: 420px;
    overflow: auto;
    padding-right: 2px;
}

.list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.list-item {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-left: 5px solid var(--primary);
    border-radius: 12px;
    padding: 14px;
}

.list-item p {
    line-height: 1.45;
    margin: 8px 0;
}

.question-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.vote-button {
    align-items: center;
    background: #f0f1f8;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    gap: 6px;
    min-height: 34px;
    padding: 0 10px;
}

.vote-button:hover {
    background: rgba(81, 67, 198, 0.12);
}

.vote-button.is-voted,
.vote-button:disabled {
    background: rgba(81, 67, 198, 0.12);
    color: var(--primary);
    cursor: default;
}

.poll h3 {
    font-size: 17px;
    font-weight: 900;
    margin: 0 0 12px;
}

.poll-option,
.result-row {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 8px;
    grid-template-columns: auto 1fr auto;
    margin-bottom: 8px;
    overflow: hidden;
    padding: 10px;
    position: relative;
}

.poll-option i,
.result-row i {
    background: rgba(139, 200, 227, 0.45);
    bottom: 0;
    left: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    z-index: 0;
}

.poll-option > *,
.result-row > * {
    position: relative;
    z-index: 1;
}

.dashboard {
    display: grid;
    gap: 24px;
}

.dash-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.stats-row,
.dashboard-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, 1fr);
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 420px;
}

.stat {
    padding: 20px;
}

.stat span {
    display: block;
    font-size: 36px;
    font-weight: 900;
    color: var(--primary);
}

.stat p {
    color: var(--muted);
    margin: 4px 0 0;
}

.university-panel {
    padding: 22px;
}

.university-stats {
    display: grid;
    gap: 10px;
}

.university-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
    padding: 12px 14px;
    position: relative;
}

.university-row div,
.university-row span {
    position: relative;
    z-index: 1;
}

.university-row strong {
    display: block;
}

.university-row span {
    color: var(--primary);
    font-size: 22px;
    font-weight: 900;
}

.university-row i {
    background: rgba(139, 200, 227, 0.45);
    bottom: 0;
    left: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    z-index: 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.result-row {
    grid-template-columns: 1fr auto;
}

.admin-email-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.admin-email-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.admin-email-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px;
}

.admin-email-row strong {
    display: block;
}

.badge {
    background: rgba(81, 67, 198, 0.12);
    border-radius: 999px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    padding: 7px 10px;
}

@media (max-width: 980px) {
    .event-grid,
    .dashboard-grid,
    .stats-row {
        grid-template-columns: 1fr;
    }

    .side-panel {
        grid-template-columns: 1fr;
    }

    .event-header {
        align-items: stretch;
        flex-direction: column;
    }

    .social-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .social-links {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .topbar,
    .dash-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .topbar,
    .page {
        padding-left: 18px;
        padding-right: 18px;
    }

    .nav {
        flex-wrap: wrap;
    }

    .event-banner {
        aspect-ratio: 4 / 2;
    }

    .event-footer-image {
        aspect-ratio: 4 / 1.4;
    }

    .event-greeting {
        font-size: 17px;
    }

    .social-links {
        display: grid;
        grid-template-columns: 1fr;
    }

    .social-links a {
        text-align: center;
    }

    .admin-email-form,
    .admin-email-row {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }
}
