/* ========== PAGE STYLES ========== */
.inscricao-container {
    max-width: 640px;
    margin: 0 auto;
}

.page-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    letter-spacing: -0.025em;
}

.page-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.05rem;
}

/* ========== CPF SEARCH CARD ========== */
.cpf-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    animation: fadeIn 0.8s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cpf-card:hover {
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.1);
}

.cpf-card h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.35rem;
    color: var(--text-main);
}

.cpf-card .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 1.5rem 0;
}

.cpf-input-group {
    display: flex;
    gap: 0.75rem;
}

.cpf-input-group input {
    flex: 1;
    padding: 0.85rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    letter-spacing: 0.05em;
}

.cpf-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.cpf-input-group input::placeholder {
    color: #9ca3af;
    letter-spacing: normal;
}

.btn-primary {
    padding: 0.85rem 1.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary {
    padding: 0.7rem 1.25rem;
    background: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #d1fae5;
    transform: translateY(-1px);
}

/* ========== LOADING SPINNER ========== */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== RESULT CARDS ========== */
.result-section {
    display: none;
    margin-top: 1.5rem;
    animation: fadeIn 0.6s ease-out;
}

.result-section.active {
    display: block;
}

/* ---- Dados do inscrito ---- */
.dados-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    animation: fadeIn 0.6s ease-out;
}

.dados-card .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #d1fae5;
    color: var(--primary-dark);
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.dados-grid {
    display: grid;
    gap: 1rem;
}

.dado-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dado-item .label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.dado-item .value {
    font-size: 1.05rem;
    color: var(--text-main);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
}

.dados-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ---- Formulário ---- */
.form-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    animation: fadeIn 0.6s ease-out;
}

.form-card h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.35rem;
    color: var(--text-main);
}

.form-card .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 1.5rem 0;
}

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

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

.form-group label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    background: white;
    color: var(--text-main);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-group select option {
    color: var(--text-main);
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Checkboxes de cursos */
.cursos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.curso-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.curso-option:hover {
    border-color: var(--primary);
    background: #f0fdf4;
}

.curso-option input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.curso-option input[type="checkbox"]:checked+.curso-label {
    color: var(--primary-dark);
    font-weight: 600;
}

.curso-option:has(input:checked) {
    border-color: var(--primary);
    background: #d1fae5;
}

.curso-label {
    font-size: 0.9rem;
    color: var(--text-main);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Atividade lotada */
.curso-lotado {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #d1d5db;
    background: #f3f4f6;
}

.curso-lotado:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

.curso-lotado input[type="checkbox"] {
    cursor: not-allowed;
}

.badge-lotado {
    display: inline-block;
    background: #fecaca;
    color: #991b1b;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-vagas {
    display: inline-block;
    background: #d1fae5;
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}

.form-submit {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

/* ========== ALERT MESSAGES ========== */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.4s ease-out;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 600px) {
    .cpf-input-group {
        flex-direction: column;
    }

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

    .page-header h1 {
        font-size: 1.5rem;
    }

    .dados-actions {
        flex-direction: column;
    }

    .form-submit {
        flex-direction: column;
    }
}

/* ========== CRACHÁ DO INSCRITO ========== */
.cracha-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0 1rem;
    position: relative;
}

/* Cordão / Lanyard */
.lanyard {
    position: relative;
    width: 200px;
    height: 80px;
    margin-bottom: -8px;
    z-index: 1;
}

.lanyard-cord {
    position: absolute;
    top: 0;
    width: 3px;
    height: 80px;
    background: linear-gradient(180deg, #10b981, #059669);
    border-radius: 2px;
}

.lanyard-cord.left {
    left: 50%;
    transform: translateX(-50%) rotate(-8deg);
    transform-origin: bottom center;
}

.lanyard-cord.right {
    left: 50%;
    transform: translateX(-50%) rotate(8deg);
    transform-origin: bottom center;
}

.lanyard-clip {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    background: linear-gradient(180deg, #d4d4d8, #a1a1aa);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.lanyard-clip::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 6px;
    background: linear-gradient(180deg, #e4e4e7, #d4d4d8);
    border-radius: 3px 3px 0 0;
}

/* Cartão — proporção 9:16 (Instagram Story) */
.cracha-card {
    width: 380px;
    min-height: 675px; /* 380 * 16/9 ≈ 675px */
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    font-family: 'Inter', sans-serif;
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: column;
}

/* Furo do cordão */
.cracha-hole {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-main, #f1f5f9);
    border: 2px solid #e2e8f0;
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cracha-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.5rem 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 16px 16px 0 0;
}

.cracha-logo {
    font-size: 2rem;
    line-height: 1;
}

.cracha-evento {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cracha-subtitulo {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
}

.cracha-body {
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, #f0fdf4 0%, white 100%);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cracha-qrcode {
    width: 130px;
    height: 130px;
    margin: 0 auto 1rem;
    padding: 8px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cracha-qrcode img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cracha-nome {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    letter-spacing: -0.02em;
}

.cracha-ingresso {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    padding: 0.3rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.cracha-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.cracha-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cracha-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.cracha-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main, #0f172a);
    word-break: break-all;
}

.cracha-cursos {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cracha-curso-tag {
    display: inline-block;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
}

/* ========== IMPRESSÃO (fallback) ========== */
@media print {
    body * {
        visibility: hidden !important;
    }

    #cracha-print,
    #cracha-print .cracha-card,
    #cracha-print .cracha-card * {
        visibility: visible !important;
    }

    #cracha-print .lanyard,
    #cracha-print .cracha-hole {
        display: none !important;
    }

    .dados-actions {
        display: none !important;
    }
}
