/* ===================================================================
   EZY LOAN APPLICATION - PREMIUM FEATURES (TIERS 1 & 2)
   Version: 2.5.0
   =================================================================== */

/* ===================================================================
   TIER 1 - HIGH IMPACT FEATURES
   =================================================================== */

/* 1. HELPER TEXT BELOW FIELDS */
.field-helper {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.field-helper::before {
    content: '💡';
    flex-shrink: 0;
    font-size: 14px;
}

.field-helper.warning {
    color: #d63638;
}

.field-helper.warning::before {
    content: '⚠️';
}

.field-helper.success {
    color: #00a32a;
}

.field-helper.success::before {
    content: '✓';
}

/* 2. FIELD GROUPING WITH VISUAL SECTIONS */
.form-section-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 16px; /* MODERN: Increased from 8px */
    padding: 24px;
    margin-bottom: 24px;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #2271b1;
}

.form-section-icon {
    font-size: 24px;
}

.form-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3338;
    margin: 0;
}

.form-section-description {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
}

/* Two column grid for fields */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* 3. SMART DEFAULTS & SUGGESTIONS */
.quick-select-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.quick-select-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-select-btn:hover {
    border-color: #2271b1;
    color: #2271b1;
    background: #f0f6fc;
}

.quick-select-btn.selected {
    background: #2271b1;
    border-color: #2271b1;
    color: white;
}

/* Mobile - smaller buttons */
@media (max-width: 768px) {
    .quick-select-btn {
        padding: 10px 14px;
        font-size: 12px;
        flex: 1 1 auto;
        min-width: 0;
    }
    
    .quick-select-buttons {
        gap: 6px;
    }
}

/* Auto-complete suggestions */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.autocomplete-suggestions.active {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.autocomplete-item:hover {
    background: #f0f6fc;
}

.autocomplete-item.highlighted {
    background: #2271b1;
    color: white;
}

/* 4. STEP SUMMARY SIDEBAR */
.application-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.step-summary-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
    background: white;
    border-radius: 16px; /* MODERN: Increased from 8px */
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 20px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3338;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.step-summary-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #e0e0e0;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.step-summary-item.completed {
    border-left-color: #00a32a;
    background: #f0f9f4;
}

.step-summary-item.active {
    border-left-color: #2271b1;
    background: #f0f6fc;
}

.step-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.step-summary-icon {
    font-size: 18px;
}

.step-summary-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3338;
}

.step-summary-details {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin-left: 26px;
}

.step-summary-details div {
    margin-bottom: 2px;
}

@media (max-width: 1024px) {
    .application-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .step-summary-sidebar {
        position: static;
        order: -1;
    }
}

/* CRITICAL: Hide sidebar on mobile phones */
@media (max-width: 768px) {
    .step-summary-sidebar {
        display: none !important;
    }
    
    .application-with-sidebar {
        grid-template-columns: 1fr !important;
    }
}

/* 5. ESTIMATED TIME REMAINING */
.time-estimate {
    text-align: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.time-estimate-value {
    font-weight: 700;
    color: #2271b1;
}

.time-estimate-icon {
    margin-right: 4px;
}

/* ===================================================================
   TIER 2 - MEDIUM IMPACT FEATURES
   =================================================================== */

/* 6. INLINE LOAN CALCULATOR */
.inline-calculator {
    background: linear-gradient(135deg, #f0f6fc 0%, #e8f4f8 100%);
    border: 2px solid #2271b1;
    border-radius: 16px; /* MODERN: Increased from 8px */
    padding: 16px;
    margin-top: 12px;
    animation: slideIn 0.3s ease;
}

.calculator-title {
    font-size: 14px;
    font-weight: 700;
    color: #2271b1;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calculator-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
}

.calculator-label {
    color: #666;
}

.calculator-value {
    font-weight: 700;
    color: #2c3338;
}

.calculator-total {
    border-top: 2px solid #2271b1;
    margin-top: 8px;
    padding-top: 12px;
}

.calculator-total .calculator-value {
    font-size: 18px;
    color: #2271b1;
}

.calculator-due-date {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #2271b1;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* 7. VISUAL PROGRESS INDICATORS */
.section-progress {
    margin-bottom: 12px;
}

.section-progress-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-progress-label {
    font-size: 12px;
    color: #666;
    min-width: 100px;
}

.section-progress-track {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.section-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #00a32a 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.section-progress-percent {
    font-size: 12px;
    font-weight: 700;
    color: #2271b1;
    min-width: 40px;
    text-align: right;
}

/* 8. ERROR PREVENTION VISUAL FEEDBACK */
.input-format-preview {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #999;
    pointer-events: none;
    font-family: monospace;
}

.form-field.has-format-preview input {
    padding-right: 120px;
}

/* Email suggestion */
.email-suggestion {
    margin-top: 6px;
    padding: 8px 12px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 12px;
    color: #856404;
    display: none;
}

.email-suggestion.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.email-suggestion-text {
    margin-right: 8px;
}

.email-suggestion-fix {
    color: #2271b1;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
}

.email-suggestion-fix:hover {
    color: #135e96;
}

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

/* 9. MOBILE-SPECIFIC ENHANCEMENTS */
.mobile-optimized-input {
    font-size: 16px !important; /* Prevents zoom on iOS */
}

/* Input mask visual */
.input-mask-display {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    pointer-events: none;
    font-family: monospace;
}

/* 10. SAVE & EMAIL LINK */
.save-resume-section {
    background: #e8f4f8;
    border: 1px solid #2271b1;
    border-radius: 16px; /* MODERN: Increased from 8px */
    padding: 16px;
    margin: 20px 0;
    text-align: center;
}

.save-resume-title {
    font-size: 14px;
    font-weight: 700;
    color: #2271b1;
    margin-bottom: 8px;
}

.save-resume-description {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.save-resume-button {
    background: white;
    border: 2px solid #2271b1;
    color: #2271b1;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-resume-button:hover {
    background: #2271b1;
    color: white;
}

.save-resume-success {
    background: #00a32a;
    color: white;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 13px;
    display: none;
}

.save-resume-success.active {
    display: block;
    animation: slideDown 0.3s ease;
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */

.text-muted {
    color: #666;
}

.text-success {
    color: #00a32a;
}

.text-primary {
    color: #2271b1;
}

.text-danger {
    color: #d63638;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ===================================================================
   ANIMATIONS
   =================================================================== */

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

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

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

@media (max-width: 768px) {
    .form-section-card {
        padding: 16px;
    }
    
    .quick-select-buttons {
        justify-content: center;
    }
    
    .inline-calculator {
        padding: 12px;
    }
    
    .calculator-row {
        font-size: 12px;
    }
    
    .form-field.has-format-preview input {
        padding-right: 12px;
    }
    
    .input-format-preview {
        display: none;
    }
}
