:root {
    --bg-1: #0f172a;
    --bg-2: #1e293b;
    --surface: rgba(15, 23, 42, 0.78);
    --surface-border: rgba(148, 163, 184, 0.25);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #fb923c;
    --accent-2: #22d3ee;
    --ok: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 15%, rgba(34, 211, 238, 0.24) 0%, transparent 32%),
        radial-gradient(circle at 90% 20%, rgba(251, 146, 60, 0.22) 0%, transparent 30%),
        linear-gradient(160deg, var(--bg-1), var(--bg-2) 68%);
}

.home-page {
    position: relative;
}

.home-page::before,
.home-page::after {
    content: '';
    position: fixed;
    z-index: -1;
    pointer-events: none;
    filter: blur(30px);
    opacity: 0.6;
}

.home-page::before {
    width: 320px;
    height: 320px;
    top: -110px;
    right: -80px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.42) 0%, rgba(251, 146, 60, 0) 70%);
}

.home-page::after {
    width: 360px;
    height: 360px;
    bottom: -160px;
    left: -120px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.36) 0%, rgba(34, 211, 238, 0) 72%);
}

.page {
    width: min(1040px, calc(100vw - 2.5rem));
    margin: 2.5rem auto;
    display: grid;
    gap: 1.25rem;
}

.hero {
    padding: 2rem;
    border-radius: 18px;
    border: 1px solid var(--surface-border);
    background: linear-gradient(130deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.78));
}

.home-page .hero {
    position: relative;
    overflow: hidden;
    box-shadow: 0 22px 50px rgba(2, 6, 23, 0.35);
}

.home-page .hero::after {
    content: '';
    position: absolute;
    inset: auto -20% -64% -20%;
    height: 180px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.18) 0%, rgba(34, 211, 238, 0) 70%);
}

.hero.compact {
    padding: 1.4rem 1.6rem;
}

.hero-actions {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.eyebrow {
    margin: 0;
    color: var(--accent-2);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.hero h1 {
    margin: 0.35rem 0 0.65rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 3.6vw, 2.3rem);
}

.subtitle {
    margin: 0;
    color: var(--muted);
    max-width: 760px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    padding: 1.4rem;
    backdrop-filter: blur(8px);
}

.card-evento {
    display: grid;
    gap: 1rem;
}

.home-page .card-evento {
    position: relative;
    overflow: hidden;
}

.home-page .card-evento::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    opacity: 0.9;
}

.evento-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.evento-head h2 {
    margin: 0 0 0.45rem;
    font-family: 'Space Grotesk', sans-serif;
}

.evento-head p {
    margin: 0;
    color: var(--muted);
}

.badge {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    color: #0f172a;
    background: linear-gradient(120deg, var(--accent), #fdba74);
    white-space: nowrap;
}

.evento-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.form-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.home-page .event-picker-form {
    grid-template-columns: minmax(320px, 1fr) auto;
    align-items: end;
}

.home-page .event-picker-select-only {
    grid-template-columns: 1fr;
}

.home-page .event-picker-form .btn-primary {
    grid-column: auto;
    min-width: 170px;
    white-space: nowrap;
}

.home-page .btn-evento-link {
    min-width: 170px;
    white-space: nowrap;
}

.home-page .event-go-form {
    width: 100%;
}


label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.field-feedback {
    min-height: 1.1rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.field-feedback.is-error {
    color: #fca5a5;
}

.home-page .form-grid label {
    background: rgba(15, 23, 42, 0.26);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    padding: 0.6rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text);
    border-radius: 10px;
    padding: 0.62rem 0.75rem;
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.68);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

input[aria-invalid="true"] {
    border-color: rgba(239, 68, 68, 0.75);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 0;
    border-radius: 11px;
    padding: 0.72rem 1rem;
    cursor: pointer;
    text-decoration: none;
    color: #0f172a;
    font-weight: 700;
    background: linear-gradient(120deg, var(--accent), #fdba74);
}

.home-page .btn-primary {
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    box-shadow: 0 8px 16px rgba(251, 146, 60, 0.22);
}

.home-page .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(251, 146, 60, 0.32);
}

.home-page .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.home-page .form-grid .btn-primary {
    grid-column: 1 / -1;
}

.btn-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 11px;
    padding: 0.58rem 0.85rem;
    text-decoration: none;
    color: var(--text);
}

.btn-nova-inscricao {
    background: #102554;
    border: 2px solid #facc15;
    color: #f8fafc;
}

.btn-nova-inscricao:hover {
    background: #0b1c43;
    border-color: #f59e0b;
}

.alert {
    border-radius: 12px;
    padding: 0.8rem 1rem;
    border: 1px solid transparent;
}

.alert.error {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.35);
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 0.76rem;
}

.status-aprovado,
.status-confirmada {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.18);
}

.status-recusado,
.status-cancelado,
.status-pagamento_nao_aprovado {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.18);
}

.card-pix {
    display: grid;
    gap: 0.7rem;
}

.pix-qrcode {
    width: min(280px, 100%);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1024px;
}

th,
td {
    text-align: left;
    padding: 0.55rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.9rem;
}

th {
    color: #cbd5e1;
    font-weight: 600;
}

.foot-note {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
}

a {
    color: var(--accent-2);
}

.admin-login {
    width: min(520px, 100%);
}

.admin-login-form {
    grid-template-columns: 1fr;
}

/* Dashboard layout */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: rgba(15, 23, 42, 0.9);
    border-right: 1px solid var(--surface-border);
    padding: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.app-title {
    font-weight: 700;
}

.sidebar-close {
    display: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
}

.menu {
    display: grid;
    gap: 0.25rem;
}

.menu-sep {
    height: 1px;
    background: var(--surface-border);
    margin: 0.5rem 0;
}

.menu-item {
    display: block;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent;
}

.menu-item.section-link {
    font-size: 1rem;
    font-weight: 600;
}

.menu-item:hover {
    background: rgba(148, 163, 184, 0.12);
    border-color: var(--surface-border);
}

.menu-item.is-active {
    background: rgba(34, 211, 238, 0.14);
    border-color: rgba(34, 211, 238, 0.4);
}

.content {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--surface-border);
    background: rgba(15, 23, 42, 0.7);
    position: sticky;
    top: 0;
    backdrop-filter: blur(8px);
    z-index: 2;
}

.burger {
    width: 38px;
    height: 34px;
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    padding: 0 6px;
    cursor: pointer;
}

.burger span {
    display: block;
    height: 2px;
    background: var(--text);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.topbar-title.topbar-title-lg {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.panel-title-lg {
    margin: 0 0 0.8rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    letter-spacing: 0.02em;
}

.btn-link.small {
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 960px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(82vw, 320px);
        transform: translateX(-120%);
        transition: transform 0.2s ease-in-out;
        z-index: 5;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close {
        display: inline-flex;
    }

    .burger {
        display: inline-flex;
    }
}

@media (max-width: 720px) {
    .page {
        width: min(1040px, calc(100vw - 1.2rem));
        margin: 1rem auto 1.4rem;
        gap: 0.95rem;
    }

    .hero,
    .card {
        padding: 1rem;
        border-radius: 14px;
    }

    .home-page .hero h1 {
        font-size: clamp(1.28rem, 7.4vw, 1.72rem);
        line-height: 1.18;
        margin-bottom: 0.5rem;
    }

    .home-page .subtitle {
        font-size: 0.94rem;
        line-height: 1.5;
    }

    .home-page .evento-head h2 {
        font-size: 1.2rem;
    }

    .home-page .badge {
        align-self: flex-start;
        font-size: 0.92rem;
        padding: 0.42rem 0.8rem;
    }

    .home-page .evento-meta {
        gap: 0.5rem;
        font-size: 0.86rem;
    }

    .home-page .form-grid {
        grid-template-columns: 1fr;
        gap: 0.68rem;
    }

    .home-page .event-picker-form .btn-primary {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .home-page .btn-evento-link {
        width: 100%;
        min-width: 0;
    }

    .home-page .event-go-form {
        display: block;
    }

    .home-page .form-grid label {
        padding: 0.5rem;
        gap: 0.3rem;
        font-size: 0.86rem;
    }

    .home-page input,
    .home-page select,
    .home-page textarea {
        min-height: 44px;
        padding: 0.66rem 0.72rem;
        font-size: 0.96rem;
    }

    .home-page .btn-primary {
        min-height: 46px;
        font-size: 0.95rem;
    }

    .evento-head {
        flex-direction: column;
    }

    .foot-note {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-title.topbar-title-lg {
        font-size: 1rem;
    }

    .panel-title-lg {
        font-size: 1.2rem;
    }
}

@media (max-width: 420px) {
    .home-page .hero,
    .home-page .card {
        padding: 0.88rem;
        border-radius: 12px;
    }

    .home-page .eyebrow {
        font-size: 0.67rem;
    }

    .home-page .hero h1 {
        font-size: 1.22rem;
    }
}
