/**
 * ===============================================
 * CALCULADORA DE PRÉSTAMOS VEHICULARES
 * Estilos Frontend v1.1.1
 * ===============================================
 * 
 * Estilos responsivos y modernos para la calculadora
 * con layout de dos columnas y diseño profesional.
 */

/* ===============================================
 * ESTRUCTURA PRINCIPAL
 * =============================================== */
.loan-calc-wrapper {
    max-width: 1600px;
    margin: 15px auto;
    padding: 30px 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 98%;
}

/* ===============================================
 * LAYOUT RESPONSIVO DE DOS COLUMNAS
 * =============================================== */

/* Layout de dos columnas */
.loan-calc-layout {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 50px;
    margin-top: 20px;
}

.loan-calc-form-column {
    padding-right: 25px;
}

.loan-calc-results-column {
    padding-left: 25px;
}

/* Responsive: Para tablets y pantallas medianas */
@media (max-width: 1024px) {
    .loan-calc-wrapper {
        width: 95%;
        padding: 25px 30px;
    }
    
    .loan-calc-layout {
        gap: 30px;
    }
}

/* Responsive: En móviles las columnas se apilan */
@media (max-width: 768px) {
    .loan-calc-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .loan-calc-form-column,
    .loan-calc-results-column {
        padding: 0;
    }
    
    .loan-calc-wrapper {
        margin: 10px;
        padding: 20px;
        width: 92%;
    }
}

.loan-calc-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.loan-calc-title {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

/* Pasos de la calculadora */
.loan-calc-step {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loan-calc-step.active {
    display: block !important;
    opacity: 1;
}

/* Formulario */
.loan-calc-form {
    display: grid;
    gap: 20px;
}

.loan-calc-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* En el layout de dos columnas, los campos del formulario van uno debajo del otro */
@media (min-width: 769px) {
    .loan-calc-layout .loan-calc-row {
        grid-template-columns: 1fr;
    }
}

/* En móviles mantener algunos campos lado a lado */
@media (max-width: 768px) {
    .loan-calc-row:not(.single-column) {
        grid-template-columns: 1fr 1fr;
    }
}

.loan-calc-field {
    display: flex;
    flex-direction: column;
}

.loan-calc-field.full-width {
    grid-column: 1 / -1;
}

.loan-calc-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 14px;
}

.loan-calc-input, 
.loan-calc-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #ffffff;
}

.loan-calc-input:focus,
.loan-calc-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.loan-calc-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

.loan-calc-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.loan-calc-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
}

.loan-calc-checkbox input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
}

.terms-link {
    color: #3498db;
    text-decoration: none;
}

.terms-link:hover {
    text-decoration: underline;
}

.loan-calc-help {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

.loan-calc-actions {
    text-align: center;
    margin-top: 20px;
}

.loan-calc-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    text-decoration: none !important;
    display: inline-block;
    box-sizing: border-box;
}

.loan-calc-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3) !important;
}

.loan-calc-btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    color: white !important;
}

.loan-calc-btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    text-decoration: none !important;
}

.loan-calc-btn-secondary {
    background: #ecf0f1 !important;
    color: #34495e !important;
}

.loan-calc-btn-secondary:hover {
    background: #d5dbdb !important;
    color: #2c3e50 !important;
    text-decoration: none !important;
}

.loan-calc-btn-success {
    background: linear-gradient(135deg, #27ae60, #229954) !important;
    color: white !important;
}

.loan-calc-btn-success:hover {
    background: linear-gradient(135deg, #229954, #1e8449) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
    text-decoration: none !important;
}

/* Resultados modernos y profesionales */
.loan-calc-results {
    margin-top: 0;
    padding: 0;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e1e8ed;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.results-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px 25px;
    text-align: center;
    margin: 0;
    position: relative;
}

.results-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Resultado principal destacado */
.results-main {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    padding: 30px 25px;
    text-align: center;
    position: relative;
}

.quota-amount {
    font-size: 36px;
    font-weight: 800;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    margin: 0;
    line-height: 1.1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.quota-period {
    font-size: 16px;
    margin-top: 8px;
    opacity: 0.9;
    font-weight: 500;
}

/* Detalles con mejor espaciado */
.results-details {
    background: #f8f9fa;
    padding: 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
    background: white;
}

.detail-row:hover {
    background: #f8f9fa;
    padding-left: 30px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row:nth-child(even) {
    background: #fdfdfd;
}

.detail-row span {
    color: #495057;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.detail-row strong {
    color: #2d3436;
    font-weight: 700;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Sección de acciones mejorada */
.results-actions {
    background: white;
    padding: 25px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.results-actions p {
    font-size: 12px;
    color: #6c757d;
    margin: 10px 0 0 0;
    line-height: 1.4;
}

/* Mejorar el botón de financiamiento */
.loan-calc-btn-success {
    background: linear-gradient(135deg, #74b9ff, #0984e3) !important;
    color: white !important;
    padding: 16px 32px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3) !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
}

.loan-calc-btn-success:hover {
    background: linear-gradient(135deg, #00a085, #00b7c4) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4) !important;
    text-decoration: none !important;
}

/* Mensaje cuando no hay resultados */
.results-placeholder {
    padding: 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
    margin-top: 20px;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.results-placeholder h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
}

.results-placeholder p {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 14px;
}

.results-placeholder ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: inline-block;
}

.results-placeholder li {
    color: #495057;
    font-size: 14px;
    margin-bottom: 8px;
    padding-left: 5px;
}

.loan-calc-results-column::before {
    display: none;
}

.results-header {
    background: linear-gradient(135deg, #2c5aa0, #1e4176);
    color: white;
    padding: 25px 20px;
    text-align: center;
    margin: 0;
    position: relative;
    overflow: hidden;
}

.results-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Resultado principal destacado */
.results-main {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    padding: 30px 25px;
    text-align: center;
    position: relative;
}





.main-result .result-label {
    font-size: 16px;
    margin-bottom: 8px;
    opacity: 0.9;
    font-weight: 500;
}

.main-quota {
    font-size: 36px !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0;
}

/* Grid de detalles compacto */
.results-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    background: white;
}

.detail-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.detail-item:hover {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    transform: translateY(-1px);
}

.detail-item:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.detail-item:nth-child(even):hover {
    background: linear-gradient(135deg, #f1f3f4, #e8f0fe);
}

.detail-icon {
    font-size: 24px;
    margin-right: 12px;
    width: 35px;
    text-align: center;
    flex-shrink: 0;
}

.detail-content {
    flex: 1;
}

.detail-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.detail-value.highlight {
    color: #e74c3c;
    font-size: 17px;
}

/* Efectos especiales */
.detail-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #2c5aa0, #1e4176);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.detail-item:hover::before {
    transform: scaleY(1);
}

/* Animaciones para los resultados */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: scale3d(.3, .3, .3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(.9, .9, .9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(.97, .97, .97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.loan-calc-results {
    animation: slideInUp 0.6s ease-out;
}

.main-quota {
    animation: bounceIn 0.8s ease-out 0.3s both;
}

.detail-item {
    animation: slideInUp 0.4s ease-out both;
}

.detail-item:nth-child(1) { animation-delay: 0.1s; }
.detail-item:nth-child(2) { animation-delay: 0.15s; }
.detail-item:nth-child(3) { animation-delay: 0.2s; }
.detail-item:nth-child(4) { animation-delay: 0.25s; }
.detail-item:nth-child(5) { animation-delay: 0.3s; }
.detail-item:nth-child(6) { animation-delay: 0.35s; }

/* Pulso para el resultado principal */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(79, 172, 254, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 172, 254, 0); }
}

.results-main {
    animation: pulse 2s infinite;
}

/* Animación de celebración */
@keyframes celebrationFloat {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateY(-50px) rotate(180deg) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) rotate(360deg) scale(0.3);
    }
}

.celebration-container {
    position: relative;
    width: 100%;
    height: 0;
    overflow: visible;
    pointer-events: none;
}

.celebration-emoji {
    position: absolute;
    font-size: 24px;
    user-select: none;
}

/* Estado animado para los resultados */
.results-animated .detail-item {
    animation: slideInUp 0.4s ease-out both;
}

.results-animated .main-quota {
    animation: bounceIn 0.8s ease-out 0.3s both;
}

/* Efectos adicionales */
.loan-calc-results:hover .detail-item {
    transform: translateY(-2px);
}

.loan-calc-results:hover .results-main {
    background: linear-gradient(135deg, #2c5aa0, #1e4176);
}

/* Responsive para tablets */
@media (max-width: 768px) {
    .results-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-quota {
        font-size: 28px !important;
    }
    
    .detail-item {
        padding: 15px;
    }
    
    .detail-value {
        font-size: 14px;
    }
}

/* Responsive para móviles */
@media (max-width: 480px) {
    .results-details-grid {
        grid-template-columns: 1fr;
    }
    
    .loan-calc-results {
        margin-top: 20px;
        border-radius: 12px;
    }
    
    .results-main {
        padding: 20px;
    }
    
    .main-quota {
        font-size: 24px !important;
    }
    
    .detail-item {
        padding: 12px 15px;
    }
}

/* Formulario de contacto */
.contact-form-section {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
}

.contact-form-header {
    text-align: center;
    margin-bottom: 20px;
}

.contact-form-header h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.contact-form-description {
    color: #6c757d;
    font-size: 14px;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 15px 0;
}

.checkbox-field input[type="checkbox"] {
    margin-top: 3px;
}

.checkbox-field label {
    font-size: 13px;
    line-height: 1.4;
    color: #495057;
}

/* Estados y animaciones */
.loan-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mensajes */
.loan-calc-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
}

.loan-calc-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.loan-calc-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Leyenda de disclaimer */
.results-disclaimer {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffecb5;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.disclaimer-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.disclaimer-icon {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.disclaimer-text {
    font-size: 12px;
    line-height: 1.4;
    color: #856404;
    text-align: justify;
}

.disclaimer-text strong {
    color: #533f03;
    font-weight: 600;
}

/* Responsive para la leyenda */
@media (max-width: 768px) {
    .disclaimer-content {
        gap: 8px;
    }
    
    .disclaimer-text {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .disclaimer-icon {
        font-size: 16px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .loan-calc-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .loan-calc-form-column,
    .loan-calc-results-column {
        padding: 0;
    }
    
    .loan-calc-wrapper {
        margin: 10px;
        padding: 20px;
    }
    
    .loan-calc-row:not(.single-column) {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .loan-calc-title {
        font-size: 24px;
    }
    
    .result-value {
        font-size: 24px;
    }
    
    .results-placeholder {
        margin-top: 0;
        padding: 20px 15px;
    }
    
    .placeholder-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .loan-calc-row {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .results-details-grid {
        grid-template-columns: 1fr;
    }
    
    .main-quota {
        font-size: 24px !important;
    }
    
    .detail-item {
        padding: 12px 15px;
    }
}

/* Iconos básicos */
.loan-icon-car::before { content: "🚗 "; }
.loan-icon-money::before { content: "💰 "; }
.loan-icon-time::before { content: "⏱️ "; }
.loan-icon-user::before { content: "👤 "; }
.loan-icon-mail::before { content: "📧 "; }
.loan-icon-phone::before { content: "📞 "; }

/* Estilos adicionales */
.contact-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.contact-header h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 22px;
}

.contact-header p {
    color: #6c757d;
    margin: 0;
    font-size: 14px;
}

.results-actions {
    background: white;
    text-align: center;
    padding: 25px 20px;
    border-top: 1px solid #f0f0f0;
}

.interest-text {
    color: #495057;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #fff3cd, #fdeaa7);
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.loan-calc-btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    margin-right: 10px;
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.loan-calc-btn-success:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.loan-calc-success {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-radius: 12px;
    border: 1px solid #b8dabc;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.loan-calc-success h4 {
    color: #155724;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.loan-calc-success p {
    color: #155724;
    margin: 0 0 25px 0;
    font-size: 16px;
}

.loan-calc-error {
    padding: 15px 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    margin: 15px 0;
}

.error-icon {
    display: inline;
    margin-right: 8px;
}

/* Nota informativa del formulario */
.form-note {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 6px;
    border-left: 3px solid #6c757d;
}

.form-note small {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
    line-height: 1.3;
}

/* Nota de contacto */
.contact-note {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #2196f3;
    margin-bottom: 15px;
    text-align: center;
}

.contact-note small {
    color: #1565c0;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}
