/* === Configurações Globais === */
:root {
    --primary-blue: #005A9C;
    --secondary-blue: #0D6EFD;
    --light-blue: #e7f1ff;
    --dark-blue: #003d6b;
    --success-green: #28a745;
    --success-green-hover: #218838;
    --text-color: #333;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #005A9C 0%, #0D6EFD 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2c3e50;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('https://images.unsplash.com/photo-1554224155-8d04421cd6e2?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    overflow-x: hidden;
    height: 100vh;
    overflow-y: auto;
}

/* === Banner de Aviso === */
#popup-banner {
    background: var(--gradient-2);
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-size: 1em;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease-out;
}

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

#close-banner-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    transition: transform 0.2s;
}

#close-banner-btn:hover {
    color: #ccc;
    transform: rotate(90deg);
}

/* === Hero Section === */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
    position: relative;
}

/* === Simulador Box === */
.simulator-box {
    background-color: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
    transition: transform 0.3s ease;
}

.simulator-box:hover {
    transform: translateY(-5px);
}

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

.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.header-icon {
    width: 60px;
    height: 60px;
    color: var(--primary-blue);
    fill: currentColor;
    margin-bottom: 10px;
}

.simulator-box h1 {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin: 0;
    font-size: 2.2em;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap; /* Garante que fique em uma linha */
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.15em;
    color: var(--primary-blue);
}

.amount-display {
    font-size: 2.2em;
    font-weight: bold;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin: 15px 0;
    animation: pulse 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* === Range Slider === */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 12px;
    background: linear-gradient(to right, var(--secondary-blue) 0%, var(--secondary-blue) 50%, #ddd 50%, #ddd 100%);
    outline: none;
    border-radius: 10px;
    transition: opacity 0.2s;
    cursor: pointer;
}

input[type="range"]:hover {
    opacity: 0.9;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: white;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--secondary-blue);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: white;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--secondary-blue);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.95em;
    color: #666;
    margin-top: 8px;
    font-weight: 500;
}

/* === Installments Grid === */
.installments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.installment-option {
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.installment-option:hover {
    border-color: var(--secondary-blue);
    background: var(--light-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
}

.installment-option input[type="radio"] {
    display: none;
}

.installment-option.selected {
    background: var(--gradient-2);
    border-color: var(--dark-blue);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 90, 156, 0.3);
}

.installment-option .months {
    font-weight: bold;
    font-size: 1.3em;
    display: block;
    margin-bottom: 8px;
}

.installment-option .value {
    font-size: 1.15em;
    display: block;
}

.installment-option.selected .value {
    font-weight: bold;
}

/* === Submit Button === */
.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 25px;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(40, 167, 69, 0.4);
}

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

/* === Modal === */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    position: relative;
    animation: slideUp 0.4s ease-out;
}

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

.modal-content h2 {
    margin-top: 0;
    color: var(--dark-blue);
    text-align: center;
    font-size: 2em;
    margin-bottom: 25px;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    color: #333;
    transform: rotate(90deg);
}

.modal-form-group {
    margin-bottom: 20px;
}

.modal-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.modal-form-group input:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.modal-submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--gradient-2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
    box-shadow: 0 6px 15px rgba(0, 90, 156, 0.3);
}

.modal-submit-btn:hover {
    background: linear-gradient(135deg, #004080 0%, #0b5ed7 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 90, 156, 0.4);
}

.modal-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === Loading Spinner === */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* === Notification Toast === */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 20px 30px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: slideInRight 0.5s ease-out;
}

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

.notification.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* === Responsive === */
@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
    }

    .hero-section {
        height: auto;
        min-height: 100vh;
        padding: 80px 20px 40px;
    }

    .simulator-box {
        padding: 30px 20px;
    }

    .simulator-box h1 {
        font-size: 2em;
    }

    .amount-display {
        font-size: 1.8em;
    }

    .installments-grid {
        gap: 12px;
    }

    .installment-option {
        padding: 15px;
    }

    .submit-btn {
        font-size: 1.3em;
        padding: 15px;
    }

    .modal-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .simulator-box h1 {
        font-size: 1.5em; /* Ajuste para caber em uma linha no mobile */
    }

    .amount-display {
        font-size: 1.5em;
    }

    #popup-banner {
        font-size: 0.9em;
        padding: 12px 15px;
    }
}
