/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:    #2a3a52;
    --primary-dk: #182636;
    --accent:     #10b981;
    --accent-lt:  #d1fae5;
    --danger:     #dc2626;
    --text:       #111827;
    --text-muted: #6b7280;
    --border:     #e5e7eb;
    --bg:         #f9fafb;
    --white:      #ffffff;
    --radius:     12px;
    --shadow-lg:  0 8px 40px rgba(0,0,0,.18);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: #2a3a52;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

/* ===== HERO ===== */
.hero {
    background: #2a3a52;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px 48px;
}

.hero-logo {
    max-width: 320px;
    width: 90%;
    margin-bottom: 20px;
}

.hero-badge {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 99px;
    margin-bottom: 16px;
}

.hero-desc {
    color: rgba(255,255,255,.82);
    font-size: 1rem;
    max-width: 340px;
    margin: 0 auto 28px;
    line-height: 1.65;
}

.hero-desc strong { color: #fff; font-weight: 700; }

.hero-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-bottom: 32px;
}

.hero-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.88);
    font-size: .92rem;
}

.hero-info-item svg { width: 17px; height: 17px; color: #6ee7b7; flex-shrink: 0; }

.hero-info-link {
    text-decoration: none;
    border-bottom: 1px dashed rgba(255,255,255,.35);
    transition: border-color .2s;
}
.hero-info-link:hover { border-bottom-color: rgba(255,255,255,.8); }

.btn-inscricao {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 16px 40px;
    border: none;
    border-radius: 99px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(16,185,129,.38);
    transition: all .2s;
    text-decoration: none;
    display: inline-block;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}

.btn-inscricao:active { transform: scale(.97); }

.hero-price {
    margin-top: 14px;
    color: rgba(255,255,255,.65);
    font-size: .88rem;
}

.hero-price strong { color: #6ee7b7; font-size: 1rem; font-weight: 700; }

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: flex-end;   /* bottom sheet em mobile */
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--white);
    border-radius: 20px 20px 0 0;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideUp .28s ease;
}

/* Handle bar para indicar que é um bottom sheet */
.modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 99px;
    margin: 12px auto 0;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-header {
    background: linear-gradient(135deg, #182636, #2a3a52);
    color: #fff;
    padding: 20px 24px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.modal-header h2 { font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.modal-header p  { font-size: .82rem; color: rgba(255,255,255,.75); margin-top: 3px; }

.btn-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
    -webkit-tap-highlight-color: transparent;
}
.btn-close:hover { background: rgba(255,255,255,.25); }

.modal-body { padding: 20px 20px 32px; }

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group label span { color: var(--danger); }

.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;         /* 16px evita zoom no iOS */
    color: var(--text);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}

.form-control.error { border-color: var(--danger); }

.field-error {
    font-size: .78rem;
    color: var(--danger);
    margin-top: 4px;
    display: none;
}

.field-error.visible { display: block; }

/* ===== PAYMENT TABS ===== */
.payment-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.tab-btn {
    padding: 12px 8px;
    border: 2px solid var(--border);
    background: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: all .2s;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 64px;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn svg { width: 22px; height: 22px; }
.tab-btn .fa-pix { font-size: 22px; line-height: 1; }

.tab-btn.active {
    border-color: var(--accent);
    background: var(--accent-lt);
    color: var(--primary-dk);
}

.tab-btn:active { opacity: .8; }

.payment-panel { display: none; }
.payment-panel.active { display: block; }

/* Cartão grid */
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== VALOR DESTAQUE ===== */
.valor-box {
    background: var(--accent-lt);
    border: 1.5px solid #a7f3d0;
    border-radius: var(--radius);
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.valor-box .label  { font-size: .84rem; color: var(--primary-dk); font-weight: 500; }
.valor-box .amount { font-size: 1.35rem; font-weight: 800; color: var(--primary-dk); }

/* ===== BOTÃO SUBMIT ===== */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(16,185,129,.32);
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}

.btn-submit:active:not(:disabled) { transform: scale(.98); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ===== PIX RESULT ===== */
#pix-result {
    display: none;
    text-align: center;
    padding: 4px 0;
}

#pix-result h3 {
    color: var(--primary-dk);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

#pix-result p { font-size: .85rem; color: var(--text-muted); margin-bottom: 16px; }

.qr-img-box {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: inline-block;
    margin-bottom: 14px;
}

.qr-img-box img { width: 190px; height: 190px; display: block; }

.copy-pix-box {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    text-align: left;
}

.copy-pix-box span {
    flex: 1;
    font-size: .75rem;
    word-break: break-all;
    color: var(--text-muted);
}

.btn-copy {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 36px;
    transition: background .2s;
    -webkit-tap-highlight-color: transparent;
}
.btn-copy:hover   { background: var(--primary-dk); }
.btn-copy.copied  { background: var(--accent); }

.pix-status-bar {
    background: #eff6ff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .83rem;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #bfdbfe;
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SUCCESS SCREEN ===== */
#success-screen {
    display: none;
    text-align: center;
    padding: 16px 0;
}

.success-icon {
    width: 72px;
    height: 72px;
    background: var(--accent-lt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon svg { width: 36px; height: 36px; color: var(--primary-dk); }

#success-screen h3 { font-size: 1.35rem; font-weight: 800; color: var(--primary-dk); margin-bottom: 8px; }
#success-screen p  { color: var(--text-muted); margin-bottom: 4px; font-size: .9rem; }

/* ===== SPINNER BUTTON ===== */
.btn-spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* ===== ALERT ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .88rem;
    margin-bottom: 14px;
    display: none;
}
.alert.error   { background: #fef2f2; border: 1px solid #fca5a5; color: var(--danger); }
.alert.visible { display: block; }

/* ===== DESKTOP ===== */
@media (min-width: 600px) {
    .modal-overlay {
        align-items: center;
        padding: 16px;
    }

    .modal {
        border-radius: 20px;
        max-height: 90vh;
    }

    .modal::before { display: none; }

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

    .modal-body { padding: 24px 28px 32px; }
    .hero-info { flex-direction: row; gap: 24px; }
    .hero-desc { font-size: 1.05rem; max-width: 420px; }
    .hero-logo { max-width: 320px; }
}
