/* ===============================================
   Pequeno Pensador - Formulário de Matrícula
   Design System & Custom Styles
   =============================================== */

:root {
    --primary-coral: #FF6B6B;
    --primary-turquoise: #4ECDC4;
    --primary-yellow: #FFE66D;
    --primary-mint: #A8E6CF;
    --dark-text: #2C3E50;
    --light-bg: #F8F9FA;
    --success: #28a745;
    --info: #17a2b8;
}

/* Container principal */
.matricula-container {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

/* Wrapper para tabs com indicador de scroll */
.nav-tabs-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

/* Cabeçalho do formulário */
.matricula-header {
    background: linear-gradient(135deg, var(--primary-coral) 0%, var(--primary-turquoise) 100%);
    color: white;
    padding: 3rem 1rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.matricula-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.matricula-header .lead {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

.matricula-header .small {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Tabs customizadas */
.nav-tabs {
    border: none;
    background: white;
    padding: 0.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    gap: 0.5rem;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    overflow: visible;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    color: var(--dark-text);
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    flex: 0 0 10%;
    opacity: 0.4;
    overflow: hidden;
}

/* Ícone dentro do nav-link */
.nav-tabs .nav-link i {
    transition: all 0.4s ease;
    font-size: 1.2rem;
}

/* Texto dentro do nav-link */
.nav-tabs .nav-link strong {
    display: inline;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    white-space: nowrap;
}

.nav-tabs .nav-link:hover {
    background-color: rgba(78, 205, 196, 0.1);
    color: var(--primary-turquoise);
    opacity: 0.7;
}

/* Aba ativa - 80% da largura com texto visível */
.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--primary-coral) 0%, var(--primary-turquoise) 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
    flex: 0 0 80%;
    z-index: 10;
    opacity: 1;
}

.nav-tabs .nav-link.active strong {
    opacity: 1;
    max-width: 300px;
    margin-left: 0.5rem;
}

/* Aba anterior (10% à esquerda - só ícone) */
.nav-tabs .nav-link.active + .nav-link,
.nav-tabs .nav-link:has(+ .nav-link.active) {
    flex: 0 0 10%;
    opacity: 0.6;
}

.nav-tabs .nav-link.active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    animation: checkPulse 1s ease infinite;
}

@keyframes checkPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

/* Responsivo para mobile */
@media (max-width: 768px) {
    .nav-tabs .nav-link.active {
        flex: 0 0 70%;
    }
    
    .nav-tabs .nav-link.active + .nav-link,
    .nav-tabs .nav-link:has(+ .nav-link.active) {
        flex: 0 0 15%;
    }
}

/* Content area */
.tab-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    min-height: 500px;
}

/* Transição suave entre abas */
.tab-pane {
    transition: opacity 0.3s ease-in-out;
}

.tab-pane:not(.active) {
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.tab-pane.active {
    opacity: 1;
    height: auto;
}

/* Form groups */
.form-label {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    position: relative;
}

/* Ícone de dados do banco junto ao label */
.label-db-icon {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--success);
    font-size: 1rem;
    animation: fadeInBounce 0.5s ease;
    vertical-align: middle;
}

@keyframes fadeInBounce {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.form-control,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-turquoise);
    box-shadow: 0 0 0 0.2rem rgba(78, 205, 196, 0.25);
}

.form-control:valid {
    border-color: var(--success);
}

/* Transição suave ao corrigir campo com erro */
.form-control,
.form-select {
    transition: all 0.3s ease;
}

.form-control.campo-obrigatorio-faltante,
.form-select.campo-obrigatorio-faltante {
    transition: all 0.3s ease, border-color 0.5s ease;
}

/* Botões */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-coral) 0%, var(--primary-turquoise) 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--primary-mint) 0%, var(--success) 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-warning {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #FFB347 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    color: var(--dark-text);
}

/* Seções do formulário */
.row {
    margin-bottom: 0.5rem;
}

hr {
    border-color: rgba(78, 205, 196, 0.3);
    margin: 2rem 0;
}

/* Loading spinner */
.spinner-border {
    color: var(--primary-turquoise) !important;
}

/* Alert/Info boxes */
.alert-info {
    background-color: rgba(78, 205, 196, 0.1);
    border: 2px solid var(--primary-turquoise);
    border-radius: 10px;
    color: var(--dark-text);
}

.alert-success {
    background-color: rgba(168, 230, 207, 0.2);
    border: 2px solid var(--primary-mint);
    border-radius: 10px;
}

.alert-danger {
    background-color: rgba(255, 107, 107, 0.1);
    border: 2px solid var(--primary-coral);
    border-radius: 10px;
}

/* Text colors */
.text-danger {
    color: var(--primary-coral) !important;
}

.text-success {
    color: var(--success) !important;
}

/* Cards para seções */
.section-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary-turquoise);
}

.section-card h5 {
    color: var(--primary-coral);
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Responsivo */
@media (max-width: 768px) {
    .matricula-header h2 {
        font-size: 1.8rem;
    }
    
    .nav-tabs {
        padding: 0.3rem;
        gap: 0.3rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        min-width: 150px;
    }
    
    .nav-tabs .nav-link i {
        display: block;
        margin: 0 0 0.25rem 0 !important;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .btn-primary,
    .btn-success,
    .btn-warning {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Indicador de scroll nas tabs (mobile) */
@media (max-width: 992px) {
    .nav-tabs::before {
        content: '← Deslize →';
        position: absolute;
        top: -25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        color: var(--primary-turquoise);
        font-weight: 600;
        animation: fadeInOut 3s ease infinite;
    }
    
    @keyframes fadeInOut {
        0%, 100% { opacity: 0; }
        50% { opacity: 1; }
    }
}

/* Progress indicator */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: #e9ecef;
    z-index: 0;
}

.progress-step {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: linear-gradient(135deg, var(--primary-coral) 0%, var(--primary-turquoise) 100%);
    border-color: var(--primary-turquoise);
    color: white;
}

.progress-step.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-pane {
    animation: fadeInUp 0.5s ease;
}

/* Checkbox e Radio customizados */
.form-check-input:checked {
    background-color: var(--primary-turquoise);
    border-color: var(--primary-turquoise);
}

.form-check-label {
    font-weight: 500;
    color: var(--dark-text);
}

/* Badge para indicadores */
.badge-custom {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #FFB347 100%);
    color: var(--dark-text);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

/* Animação de shake para campo obrigatório */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-animation {
    animation: shake 0.5s ease-in-out;
}

/* Campo obrigatório faltante */
.campo-obrigatorio-faltante {
    border-color: #FF6B6B !important;
    border-width: 3px !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 107, 0.25) !important;
    background-color: rgba(255, 107, 107, 0.05) !important;
}

/* Alerta flutuante para campo faltante */
.alerta-campo-faltante {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
    z-index: 9999;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    animation: slideDown 0.3s ease-out;
    max-width: 90%;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.alerta-campo-faltante i {
    font-size: 1.5rem;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
