/* ==============================================================================
   SORVETADA ESCOLAR (9º ANO) — DESIGN SYSTEM & ESTILOS PRINCIPAIS
   Paleta: Azul Marinho Escolar (#1e3a8a), Ciano Refrescante (#0ea5e9), 
           Sorvete Rosa/Morango (#f43f5e), Baunilha Suave (#fffbeb)
   ============================================================================== */

:root {
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --accent: #f43f5e;
    --accent-light: #fda4af;
    --ice-cyan: #0ea5e9;
    --ice-bg: #f0f9ff;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

/* Container Principal */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header & Banner */
.hero-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 100%);
    color: #ffffff;
    padding: 2.2rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-header::before {
    content: "🍦 🍧 🍨";
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 3.5rem;
    opacity: 0.15;
    pointer-events: none;
}

.hero-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.9;
    max-width: 650px;
    margin: 0 auto 1.5rem auto;
}

.hero-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.92rem;
}

.hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
}

/* Navegação em Abas */
.nav-tabs {
    display: flex;
    background: #e2e8f0;
    padding: 0.35rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    gap: 0.35rem;
}

.nav-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.8rem 1rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nav-tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Cards & Formulários */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.75rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* Participantes Dinâmicos */
.participante-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
}

.participante-badge {
    background: var(--primary);
    color: #ffffff;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.btn-remove-part {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-remove-part:hover {
    background: #fecaca;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: #172554;
}

.btn-accent {
    background: var(--accent);
    color: #ffffff;
}

.btn-accent:hover {
    background: #e11d48;
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: #059669;
}

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

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-block {
    width: 100%;
}

/* Modal PIX e Ingresso */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
}

.pix-box {
    text-align: center;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.25rem 0;
}

.pix-qrcode-img {
    max-width: 240px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.pix-code-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-all;
    max-height: 65px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
    text-align: left;
}

/* Ingressos Digitais */
.ticket-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ticket-header {
    width: 100%;
    border-bottom: 2px dashed #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.ticket-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
}

.ticket-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 0.35rem;
}

.badge-confirmado { background: #dcfce7; color: #166534; }
.badge-pendente { background: #fef3c7; color: #92400e; }
.badge-fora { background: #f1f5f9; color: #475569; }
.badge-presente { background: #dbeafe; color: #1e40af; }

.ticket-qrcode {
    max-width: 220px;
    width: 100%;
    height: auto;
    margin: 1rem 0;
}

/* Rodapé */
.footer {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsividade Mobile */
@media (max-width: 640px) {
    .hero-title { font-size: 1.5rem; }
    .hero-meta { flex-direction: column; gap: 0.5rem; align-items: center; }
    .card { padding: 1.25rem; }
    .modal-content { padding: 1.25rem; }
}
