/*
 * Ingresso-Online.com — Design System Premium
 * Camada exclusivamente visual. Não contém regras de negócio, valores críticos ou integrações.
 */

:root {
    color-scheme: dark;
    --io-bg: #070B14;
    --io-bg-soft: #0A1020;
    --io-panel: #0F172A;
    --io-panel-2: #111C33;
    --io-panel-3: #16233F;
    --io-line: rgba(148, 163, 184, 0.18);
    --io-line-strong: rgba(148, 163, 184, 0.30);
    --io-text: #F8FAFC;
    --io-text-soft: #CBD5E1;
    --io-muted: #94A3B8;
    --io-blue: #2563EB;
    --io-blue-soft: rgba(37, 99, 235, 0.16);
    --io-purple: #7C3AED;
    --io-purple-soft: rgba(124, 58, 237, 0.16);
    --io-cta: #FFB000;
    --io-cta-2: #FFD166;
    --io-success: #22C55E;
    --io-danger: #EF4444;
    --io-warning: #F59E0B;
    --io-radius-sm: 10px;
    --io-radius-md: 16px;
    --io-radius-lg: 22px;
    --io-radius-xl: 28px;
    --io-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
    --io-shadow-card: 0 18px 50px rgba(0, 0, 0, 0.22);
    --io-container: min(1180px, calc(100% - 32px));

    /* Compatibilidade com seletores legados */
    --bg-color: var(--io-bg);
    --card-bg: var(--io-panel);
    --primary-red: var(--io-cta);
    --text-main: var(--io-text);
    --text-muted: var(--io-muted);
    --border-radius: var(--io-radius-md);
    --container-padding: 16px;
    --shadow: var(--io-shadow-card);
    --elevation-bg: var(--io-panel);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 34rem),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.20), transparent 30rem),
        var(--io-bg);
    color: var(--io-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body.io-admin-body,
body.admin-body {
    color-scheme: light;
    background: #F6F8FC;
    color: #0F172A;
}

img, svg {
    max-width: 100%;
}

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

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.container,
.io-wrap,
.wrap {
    width: var(--io-container);
    max-width: 1180px;
    margin-inline: auto;
}

.io-glass,
.panel,
.event-card,
.ticket-card,
.search-panel,
.modal-content,
.tax-container,
.description-content,
.policy-card,
.org-card,
.social-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(10, 18, 32, 0.92));
    border: 1px solid var(--io-line);
    box-shadow: var(--io-shadow-card);
}

.io-brand,
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.io-mark,
.brand-mark,
.mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--io-blue), var(--io-purple));
    position: relative;
    flex: 0 0 auto;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.30);
}

.io-mark::before,
.brand-mark::before,
.mark::before {
    content: "";
    position: absolute;
    width: 19px;
    height: 12px;
    left: 8px;
    top: 12px;
    border-radius: 3px;
    background: #F8FAFC;
    transform: rotate(-12deg);
}

.io-mark::after,
.brand-mark::after,
.mark::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 4px;
    right: 9px;
    top: 16px;
    border-radius: 999px;
    background: var(--io-blue);
}

.io-header,
.topbar,
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 11, 20, 0.88);
    border-bottom: 1px solid var(--io-line);
    backdrop-filter: blur(18px);
}

.io-nav,
.nav,
.header-content {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.io-actions,
.nav-actions,
.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.io-btn,
.btn,
.card-cta,
.btn-login,
.btn-buy,
.btn-finish,
.btn-copy,
.btn-follow,
.btn-clube-ingresso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--io-line-strong);
    border-radius: 13px;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.78);
    color: var(--io-text);
    font-weight: 850;
    letter-spacing: -0.01em;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.io-btn:hover,
.btn:hover,
.card-cta:hover,
.btn-buy:hover,
.btn-finish:hover,
.btn-copy:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 176, 0, 0.42);
}

.io-btn-cta,
.btn-primary,
.btn-buy,
.btn-finish,
.search-panel button,
.card-cta {
    border-color: transparent;
    background: linear-gradient(135deg, var(--io-cta), var(--io-cta-2));
    color: #241700;
    box-shadow: 0 14px 34px rgba(255, 176, 0, 0.24);
}

.btn-buy:disabled,
.btn-finish:disabled,
button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.io-btn-secondary,
.btn-secondary {
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.26);
    color: #BFDBFE;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.26);
    color: #FCA5A5;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--io-line-strong);
    border-radius: 13px;
    background: rgba(7, 11, 20, 0.70);
    color: var(--io-text);
    padding: 12px 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(37, 99, 235, 0.74);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

label {
    font-weight: 800;
}

.badge,
.pill,
.status,
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.24);
    background: var(--io-blue-soft);
    color: #BFDBFE;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.badge.success,
.status-paid,
.status-published {
    border-color: rgba(34, 197, 94, 0.24);
    background: rgba(34, 197, 94, 0.13);
    color: #BBF7D0;
}

.badge.warning,
.status-pending,
.status-draft,
.status-pending_review {
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.13);
    color: #FDE68A;
}

.badge.danger,
.status-canceled,
.status-payment_failed,
.status-cancelled {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.13);
    color: #FCA5A5;
}

.section,
.event-hero,
.social-section,
.tickets-section,
.tax-breakdown-section,
.description-section,
.policies-section,
.organizer-section {
    padding: 34px 0;
    animation: ioFadeUp .38s ease both;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 18px;
}

.section-head h2,
.section-title,
.panel h2 {
    margin: 0;
    font-size: clamp(22px, 3vw, 30px);
    letter-spacing: -0.035em;
}

.section-head span,
.empty-state,
.meta-row,
.tax-detail,
.ticket-lot,
.description,
.modal-subtitle,
.trust,
.social-text,
.tax-note,
.tax-subnote,
.footer-bottom,
.footer-col a {
    color: var(--io-muted);
}

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

.event-card {
    overflow: hidden;
    border-radius: var(--io-radius-lg);
    position: relative;
    transform: translateZ(0);
}

.event-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 35%, rgba(7, 11, 20, 0.08));
}

.event-card img,
.banner-img,
.media img {
    width: 100%;
    display: block;
    object-fit: cover;
    background: #111827;
}

.event-card img {
    aspect-ratio: 16 / 9;
}

.event-card-body {
    padding: 18px;
}

.event-card h3,
.ticket-name,
.event-title {
    color: var(--io-text);
    letter-spacing: -0.035em;
}

.event-card h3 {
    margin: 12px 0 8px;
    font-size: 20px;
    line-height: 1.2;
}

.event-card p {
    margin: 6px 0;
    color: var(--io-muted);
    font-size: 14px;
}

.event-card-footer,
.footer-content,
.total-info,
.ticket-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.event-card-footer {
    margin: 16px 0;
}

.event-card-footer strong,
.ticket-price,
.total-price {
    color: var(--io-text);
    font-weight: 950;
}

.event-card-footer span {
    color: #86EFAC;
    font-size: 12px;
    font-weight: 850;
}

.panel,
.event-details,
.tax-container,
.description-content,
.policy-card,
.org-card {
    border-radius: var(--io-radius-lg);
    padding: 22px;
}

.ticket-card {
    border-radius: var(--io-radius-md);
    padding: 17px;
    margin: 12px 0;
}

.quantity-selector {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(7, 11, 20, 0.58);
    border: 1px solid var(--io-line);
}

.qty-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid var(--io-line-strong);
    background: rgba(15, 23, 42, 0.95);
    color: var(--io-text);
    font-weight: 950;
}

.qty-value {
    min-width: 22px;
    text-align: center;
    font-weight: 950;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}

.modal-content {
    width: min(480px, 100%);
    border-radius: var(--io-radius-xl);
    padding: 28px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    border: 0;
    background: transparent;
    color: var(--io-muted);
    font-size: 28px;
}

.form-group {
    margin: 14px 0;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--io-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pix-code-box {
    margin: 18px 0;
    padding: 16px;
    border-radius: var(--io-radius-md);
    border: 1px dashed rgba(148, 163, 184, 0.40);
    background: rgba(7, 11, 20, 0.76);
    color: var(--io-text-soft);
    word-break: break-word;
}

.main-footer,
footer {
    margin-top: 38px;
    border-top: 1px solid var(--io-line);
    padding: 34px 0;
    color: var(--io-muted);
}

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

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.footer-col li {
    margin-bottom: 8px;
}

.empty-state {
    border: 1px dashed var(--io-line-strong);
    border-radius: var(--io-radius-md);
    padding: 18px;
    background: rgba(15, 23, 42, 0.48);
}

.io-admin-shell,
.shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}

.io-admin-sidebar,
.shell > aside {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 18rem),
        #070B14;
    color: #F8FAFC;
    padding: 24px;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
}

.io-admin-sidebar nav a,
.shell > aside nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin: 5px 0;
    border-radius: 13px;
    color: #CBD5E1;
    font-weight: 750;
}

.io-admin-sidebar nav a.active,
.io-admin-sidebar nav a:hover,
.shell > aside nav a.active,
.shell > aside nav a:hover {
    background: rgba(37, 99, 235, 0.18);
    color: #FFFFFF;
}

.io-admin-main,
.shell > main {
    padding: 30px;
    min-width: 0;
}

.io-admin-header,
.shell > main > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.io-admin-panel,
.admin-panel,
.shell .panel {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.metric {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    padding: 17px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.05);
}

.metric span {
    display: block;
    color: #64748B;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.metric strong {
    display: block;
    margin-top: 8px;
    color: #0F172A;
    font-size: 27px;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

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

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid #E2E8F0;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

th {
    color: #64748B;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.admin-muted,
.table-muted {
    color: #64748B;
}

.error {
    margin-bottom: 16px;
    border: 1px solid #FECACA;
    border-radius: 14px;
    background: #FEF2F2;
    color: #B91C1C;
    padding: 13px 14px;
}

@keyframes ioFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .event-grid,
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .io-nav,
    .nav,
    .header-content,
    .io-admin-header,
    .shell > main > header {
        align-items: flex-start;
        flex-direction: column;
    }

    .io-admin-shell,
    .shell {
        grid-template-columns: 1fr;
    }

    .io-admin-sidebar,
    .shell > aside {
        position: static;
        border-right: 0;
    }

    .io-admin-sidebar nav,
    .shell > aside nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .io-admin-sidebar nav a,
    .shell > aside nav a {
        white-space: nowrap;
        flex: 0 0 auto;
    }
}

@media (max-width: 720px) {
    :root {
        --io-container: min(100% - 24px, 1180px);
    }

    .event-grid,
    .metrics,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .ticket-card,
    .event-card-footer,
    .footer-content,
    .total-info {
        align-items: flex-start;
        flex-direction: column;
    }

    .io-actions,
    .nav-actions {
        width: 100%;
    }

    .io-actions .io-btn,
    .nav-actions .btn {
        flex: 1 1 auto;
    }

    .io-admin-main,
    .shell > main {
        padding: 18px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Refinamentos administrativos aplicados quando o CSS compartilhado é carregado após estilos locais. */
body.admin-body .btn,
body.io-admin-body .btn {
    background: #E2E8F0;
    color: #0F172A;
    border-color: #CBD5E1;
    box-shadow: none;
}

body.admin-body .btn:hover,
body.io-admin-body .btn:hover {
    border-color: #94A3B8;
    background: #CBD5E1;
}

body.admin-body .btn-primary,
body.io-admin-body .btn-primary {
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.20);
}

body.admin-body .btn-danger,
body.io-admin-body .btn-danger {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FECACA;
}

body.admin-body input,
body.admin-body select,
body.admin-body textarea,
body.io-admin-body input,
body.io-admin-body select,
body.io-admin-body textarea {
    background: #FFFFFF;
    color: #0F172A;
    border-color: #CBD5E1;
}

body.admin-body code,
body.io-admin-body code {
    display: inline-block;
    max-width: 100%;
    border-radius: 8px;
    background: #E2E8F0;
    color: #0F172A;
    padding: 3px 6px;
    word-break: break-all;
}

body.admin-body .admin-section-kicker,
body.io-admin-body .admin-section-kicker {
    display: inline-block;
    margin-bottom: 6px;
    color: #2563EB;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

body.admin-body .panel-head,
body.io-admin-body .panel-head {
    background: linear-gradient(180deg, #FFFFFF, #F8FAFC);
}

body.admin-body .status.paid,
body.admin-body .status.valid,
body.admin-body .status.published,
body.admin-body .check.used {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

body.admin-body .status.pending,
body.admin-body .status.draft,
body.admin-body .status.pending_review,
body.admin-body .check {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

body.admin-body .status.payment_failed,
body.admin-body .status.expired,
body.admin-body .status.canceled,
body.admin-body .status.cancelled,
body.admin-body .status.paused {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}
