/* ============================================
   Step Pages Styles
   ============================================ */

.step-page {
    background: var(--bg-light);
    min-height: 100vh;
    padding: 40px 20px;
}

.step-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

.step-main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* En móvil, el resumen va arriba */
@media (max-width: 968px) {
    .step-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .loan-summary-sidebar {
        order: -1;
    }
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: var(--transition);
}

.progress-step.active .step-number {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.progress-step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    font-weight: 500;
}

.progress-step.active .step-label {
    color: var(--text-dark);
    font-weight: 600;
}

/* ============================================
   Form Container
   ============================================ */
.form-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-align: center;
}

.form-subtitle {
    font-size: 16px;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 32px;
}

/* ============================================
   Form Fields
   ============================================ */
.step-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.field-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.field-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-white);
}

.field-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Solo mostrar error en campos touched */
.field-input.touched:invalid {
    border-color: var(--error-color);
}

/* No mostrar error en campos no touched, incluso si son required */
.field-input:invalid:not(:placeholder-shown):not(:focus):not(.touched) {
    border-color: var(--border-color);
}

.field-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.field-error {
    font-size: 12px;
    color: var(--error-color);
    margin-top: 4px;
    display: none;
}

.field-error.show {
    display: block;
}

/* ============================================
   Checkboxes
   ============================================ */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ============================================
   Form Actions
   ============================================ */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.btn-primary {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    flex: 1;
    background: transparent;
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    padding: 16px 32px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--text-dark);
    background: var(--bg-light);
}

/* ============================================
   Login Page Specific Styles
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 32px;
    width: 100%;
}

.login-logo {
    max-width: 200px;
    max-height: 50px;
    height: auto;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .logo-img {
        max-height: 35px;
        max-width: 150px;
    }
    
    .login-logo {
        max-height: 35px;
        max-width: 150px;
    }
    
    .form-container {
        padding: 24px;
    }

    .form-title {
        font-size: 24px;
    }

    .progress-bar {
        margin-bottom: 24px;
    }

    .step-label {
        font-size: 10px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ============================================
   Forgot Password Modal
   ============================================ */
.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-container {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #2C3E50;
    margin: 0 0 8px 0;
    text-align: center;
}

.modal-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px 0;
    text-align: center;
}

.forgot-step .form-field {
    margin-bottom: 20px;
}

/* Code Input */
.code-input-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 24px 0;
}

.code-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s;
}

.code-digit:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.code-digit.filled {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.code-digit.error {
    border-color: #e74c3c;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.attempts-info {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin: 10px 0;
}

.resend-info {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.btn-link:disabled {
    color: #999;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .modal-container {
        padding: 24px;
    }
    
    .code-digit {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }
    
    .code-input-container {
        gap: 6px;
    }
}

