/**
 * Seguradora ALM - Formulário de Cotação CSS
 */

/* ==========================================================================
   HERO COTAÇÃO
   ========================================================================== */

.hero-cotacao {
    background: linear-gradient(135deg, #0b5185 0%, #007e7a 100%);
    padding: 60px 0;
    color: white;
}

.hero-cotacao h1 {
    font-size: 2rem;
    font-weight: 700;
}

.hero-cotacao p {
    font-size: 1rem;
    opacity: 0.9;
}

/* ==========================================================================
   FORM STEPS
   ========================================================================== */

.form-steps {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 120px;
    position: relative;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 20px);
    width: calc(100% - 20px);
    height: 2px;
    background: #dee2e6;
}

.step-item.completed:not(:last-child)::after {
    background: #0b5185;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dee2e6;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.step-item.active .step-number,
.step-item.completed .step-number {
    background: linear-gradient(135deg, #0b5185 0%, #007e7a 100%);
    color: white;
}

.step-item.completed .step-number::after {
    content: '✓';
    position: absolute;
}

.step-item.completed .step-number {
    font-size: 0;
}

.step-label {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    line-height: 1.2;
}

.step-item.active .step-label {
    color: #0b5185;
    font-weight: 600;
}

/* ==========================================================================
   FORM SECTIONS
   ========================================================================== */

.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    font-size: 1.1rem;
}

.section-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b5185 0%, #007e7a 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ==========================================================================
   FORM NAVIGATION
   ========================================================================== */

.form-navigation {
    display: flex;
    justify-content: space-between;
}

.btn-prev,
.btn-next,
.btn-submit {
    min-width: 140px;
}

/* ==========================================================================
   FORM FIELDS
   ========================================================================== */

.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #0b5185;
    box-shadow: 0 0 0 0.2rem rgba(11, 81, 133, 0.15);
}

.form-check-input:checked {
    background-color: #0b5185;
    border-color: #0b5185;
}

.form-text {
    color: #666;
}

.invalid-feedback {
    font-size: 0.8rem;
}

/* Input com erro */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
}

/* ==========================================================================
   RESULTADO COTAÇÃO
   ========================================================================== */

.parcelas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.parcela-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
}

.parcela-item .parcela-qtd {
    display: block;
    font-weight: 600;
    color: #0b5185;
}

.parcela-item .parcela-valor {
    color: #666;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading .btn-text {
    display: none;
}

.btn-submit .btn-loading {
    display: none;
}

.btn-submit.loading .btn-loading {
    display: inline-block;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .hero-cotacao {
        padding: 40px 0;
    }
    
    .hero-cotacao h1 {
        font-size: 1.5rem;
    }
    
    .form-steps {
        gap: 5px;
    }
    
    .step-item {
        max-width: 80px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .parcelas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-prev,
    .btn-next,
    .btn-submit {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .step-item:not(:last-child)::after {
        display: none;
    }
}

/* ==========================================================================
   CARDS DE PREÇO/PLANO
   ========================================================================== */

.preco-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.preco-card:hover {
    border-color: #0b5185;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(11, 81, 133, 0.15);
}

.preco-card.selected,
.preco-card.border-primary {
    border-color: #0b5185 !important;
    background: rgba(11, 81, 133, 0.05);
}

.preco-card.selected .card-title,
.preco-card.border-primary .card-title {
    color: #0b5185;
}

.preco-card .card-body {
    padding: 1.5rem;
}

.preco-card .card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.preco-valor {
    font-size: 0.9rem;
}

.cursor-pointer {
    cursor: pointer;
}

/* Container de preço calculado */
.preco-calculado .card {
    background: linear-gradient(135deg, rgba(11, 81, 133, 0.05) 0%, rgba(0, 126, 122, 0.05) 100%);
}

.preco-calculado h3 {
    font-weight: 700;
}

/* Preço único */
.preco-calculado .card-body {
    padding: 1.25rem;
}

/* Animação de loading */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.preco-calculado .spinner-border {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive para cards de preço */
@media (max-width: 768px) {
    .preco-card .card-body {
        padding: 1rem;
    }
    
    .preco-card .card-title {
        font-size: 0.95rem;
    }
    
    .preco-valor {
        font-size: 0.85rem;
    }
}
