/* ===========================
   EMI Calculator - Complete CSS File
   FinPluss Design System
   Version: 2.0
   =========================== */

/* ========== CSS VARIABLES ========== */
:root {
    --emi-primary-blue: #243E93;
    --emi-primary-orange: #F36D21;
    --emi-success-green: #10b981;
    --emi-warning-yellow: #f59e0b;
    --emi-error-red: #ef4444;
    --emi-light-gray: #f8f9fa;
    --emi-light-blue: #eff6ff;
    --emi-border-gray: #e5e7eb;
    --emi-text-primary: #1f2937;
    --emi-text-secondary: #6b7280;
    --emi-white: #ffffff;
    --emi-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --emi-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --emi-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.12);
    --emi-transition: all 0.3s ease;
    
    /* Animation Variables */
    --animation-duration: 0.6s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --stagger-delay: 0.1s;
}

/* ========== RESET & BASE ========== */
.emi-calculator-page * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========== LAZY LOADING ANIMATIONS ========== */
.lazy-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--animation-duration) var(--animation-easing), 
                transform var(--animation-duration) var(--animation-easing);
    will-change: opacity, transform;
}

.lazy-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

.lazy-scale {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    will-change: opacity, transform;
}

.lazy-scale.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Stagger Delays */
[data-delay="1"] { transition-delay: calc(var(--stagger-delay) * 1); }
[data-delay="2"] { transition-delay: calc(var(--stagger-delay) * 2); }
[data-delay="3"] { transition-delay: calc(var(--stagger-delay) * 3); }
[data-delay="4"] { transition-delay: calc(var(--stagger-delay) * 4); }

/* Lazy Section Loading */
.lazy-section {
    opacity: 0;
}

.lazy-section.loaded {
    opacity: 1;
    transition: opacity 0.8s ease;
}

/* ========== CONTAINER ========== */
.emi-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== HERO SECTION ========== */
.emi-hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 60px 0 40px;
    position: relative;
    overflow: hidden;
}

.emi-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(36, 62, 147, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.emi-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(243, 109, 33, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    33% { transform: translateY(-20px) translateX(10px); }
    66% { transform: translateY(10px) translateX(-10px); }
}

.emi-hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.emi-hero-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    margin-bottom: 15px;
}

.emi-title-blue { color: var(--emi-primary-blue); }
.emi-title-orange { color: var(--emi-primary-orange); }

.emi-hero-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--emi-text-secondary);
}

/* ========== MAIN SECTION ========== */
.emi-main-section {
    padding: 40px 0;
    background: #f5f6f8;
}

/* ========== CALCULATOR WRAPPER ========== */
.emi-calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--emi-white);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 520px;
}

/* ========== INPUT PANEL ========== */
.emi-input-panel {
    padding: 20px;
    background: var(--emi-white);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Tabs */
.emi-tabs-container {
    margin-bottom: 20px;
}

.emi-tabs {
    display: flex;
    gap: 8px;
    background: var(--emi-light-gray);
    padding: 4px;
    border-radius: 8px;
}

.emi-tab {
    flex: 1;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--emi-transition);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--emi-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.emi-tab.active {
    background: var(--emi-primary-orange);
    color: var(--emi-white);
    box-shadow: 0 2px 8px rgba(243, 109, 33, 0.3);
}

.emi-tab.completed:not(.active) {
    background: var(--emi-success-green);
    color: var(--emi-white);
    cursor: pointer;
}

.emi-tab.completed:not(.active):hover {
    background: #0ea76f;
}

.emi-tab-number {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    line-height: 20px;
    font-size: 11px;
}

.emi-tab.active .emi-tab-number {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 700;
}

/* Error Container */
.emi-error-container {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    animation: slideDown 0.3s ease;
}

.emi-error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--emi-error-red);
    font-size: 13px;
    font-weight: 500;
}

.emi-error-message i {
    font-size: 16px;
}

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

/* Tab Content */
.emi-tab-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.emi-tab-panel {
    display: none;
    min-height: 320px;
}

.emi-tab-panel.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

/* Form Elements */
.emi-form-section {
    flex: 1;
}

.emi-form-group {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.emi-form-label {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--emi-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emi-form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emi-tooltip {
    font-size: 10px;
    color: var(--emi-primary-orange);
    cursor: help;
    margin-left: auto;
}

/* Loan Type Selector */
.emi-loan-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.emi-loan-type {
    padding: 8px 4px;
    background: var(--emi-light-gray);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--emi-transition);
    font-size: 10px;
    color: var(--emi-text-secondary);
    text-align: center;
}

.emi-loan-type i {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.emi-loan-type.active {
    background: var(--emi-primary-orange);
    color: white;
    border-color: var(--emi-primary-orange);
}

.emi-loan-type:hover:not(.active) {
    border-color: var(--emi-primary-blue);
}

/* Input Elements */
.emi-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid var(--emi-border-gray);
    border-radius: 6px;
    overflow: hidden;
    transition: var(--emi-transition);
    height: 36px;
    width: 100%;
}

.emi-input-wrapper:focus-within {
    border-color: var(--emi-primary-orange);
    box-shadow: 0 0 0 3px rgba(243, 109, 33, 0.1);
}

.emi-input {
    flex: 1;
    padding: 0 10px;
    border: none;
    outline: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--emi-text-primary);
    background: transparent;
    height: 100%;
}

.emi-prefix,
.emi-suffix {
    padding: 0 10px;
    background: var(--emi-light-gray);
    color: var(--emi-text-secondary);
    font-weight: 600;
    font-size: 13px;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Tenure Toggle */
.emi-tenure-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.emi-tenure-btn {
    flex: 1;
    padding: 6px;
    background: var(--emi-light-gray);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: var(--emi-text-secondary);
    transition: var(--emi-transition);
}

.emi-tenure-btn.active {
    background: var(--emi-primary-blue);
    color: white;
    border-color: var(--emi-primary-blue);
}

/* Range Slider */
.emi-range {
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--emi-border-gray);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.emi-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--emi-primary-orange);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.emi-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--emi-primary-orange);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.emi-percentage-display {
    font-size: 11px;
    color: var(--emi-primary-orange);
    font-weight: 600;
}

/* Panel Footer */
.emi-panel-footer {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

.emi-footer-buttons {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

/* Buttons */
.emi-reset-btn {
    padding: 8px 14px;
    background: var(--emi-white);
    color: var(--emi-error-red);
    border: 1px solid var(--emi-error-red);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--emi-transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.emi-reset-btn:hover {
    background: var(--emi-error-red);
    color: var(--emi-white);
}

.emi-back-btn,
.emi-next-btn,
.emi-calculate-btn {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--emi-transition);
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.emi-back-btn {
    background: var(--emi-white);
    color: var(--emi-text-secondary);
    border: 1px solid var(--emi-border-gray);
}

.emi-back-btn:hover {
    border-color: var(--emi-primary-blue);
    color: var(--emi-primary-blue);
}

.emi-next-btn {
    background: var(--emi-primary-orange);
    color: var(--emi-white);
    box-shadow: 0 2px 6px rgba(243, 109, 33, 0.2);
}

.emi-next-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(243, 109, 33, 0.3);
}

.emi-calculate-btn {
    background: var(--emi-primary-blue);
    color: var(--emi-white);
    box-shadow: 0 2px 6px rgba(36, 62, 147, 0.2);
}

.emi-calculate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(36, 62, 147, 0.3);
}

.emi-calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========== RESULTS PANEL ========== */
.emi-results-panel {
    padding: 20px;
    background: #f8f9fb;
    border-left: 1px solid var(--emi-border-gray);
    display: flex;
    flex-direction: column;
    height: 550px;
}

/* Placeholder */
.emi-results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--emi-text-secondary);
}

.emi-results-placeholder i {
    font-size: 48px;
    color: var(--emi-primary-orange);
    opacity: 0.3;
    margin-bottom: 15px;
}

.emi-results-placeholder h3 {
    font-size: 18px;
    color: var(--emi-primary-blue);
    margin-bottom: 6px;
}

.emi-results-placeholder p {
    font-size: 13px;
    color: var(--emi-text-secondary);
}

/* Loading Container */
.emi-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 20px;
}

.emi-loader {
    margin-bottom: 20px;
}

.loader-circle {
    width: 50px;
    height: 50px;
    border: 3px solid var(--emi-light-gray);
    border-top: 3px solid var(--emi-primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.emi-loading-text {
    font-size: 18px;
    color: var(--emi-primary-blue);
    margin-bottom: 8px;
    font-weight: 600;
}

.emi-loading-subtitle {
    font-size: 13px;
    color: var(--emi-text-secondary);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Results Content */
.emi-results-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Primary Result Card */
.emi-result-card {
    background: linear-gradient(135deg, var(--emi-primary-blue), #4a5fc1);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--emi-white);
    box-shadow: 0 4px 12px rgba(36, 62, 147, 0.2);
}

.emi-result-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.emi-result-content {
    flex: 1;
}

.emi-result-label {
    font-size: 10px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.emi-result-amount {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 4px 0;
}

.emi-result-subtitle {
    font-size: 11px;
    opacity: 0.85;
}

/* Metrics Grid */
.emi-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.emi-metric-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--emi-white);
    border-radius: 6px;
    border: 1px solid var(--emi-border-gray);
    transition: var(--emi-transition);
}

.emi-metric-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.emi-metric-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--emi-white);
}

.emi-metric-icon.orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.emi-metric-icon.blue { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.emi-metric-icon.green { background: linear-gradient(135deg, #34d399, #10b981); }
.emi-metric-icon.purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.emi-metric-icon.teal { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }
.emi-metric-icon.pink { background: linear-gradient(135deg, #f472b6, #ec4899); }

.emi-metric-content {
    flex: 1;
    min-width: 0;
}

.emi-metric-label {
    font-size: 9px;
    color: var(--emi-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.emi-metric-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--emi-text-primary);
    margin-top: 2px;
}

.emi-metric-subtitle {
    font-size: 9px;
    color: var(--emi-text-secondary);
    margin-top: 1px;
}

/* Chart Container */
.emi-chart-container {
    background: white;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid var(--emi-border-gray);
    height: 120px;
}

/* Action Buttons */
.emi-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.emi-action-btn {
    flex: 1;
    padding: 8px;
    background: var(--emi-white);
    border: 1px solid var(--emi-border-gray);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--emi-text-primary);
    cursor: pointer;
    transition: var(--emi-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.emi-action-btn:hover {
    border-color: var(--emi-primary-orange);
    color: var(--emi-primary-orange);
    background: rgba(243, 109, 33, 0.05);
}

/* ========== MODAL ========== */
.emi-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.emi-modal-content {
    background: var(--emi-white);
    border-radius: 10px;
    max-width: 700px;
    width: 100%;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.emi-modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--emi-border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emi-modal-header h3 {
    font-size: 16px;
    color: var(--emi-primary-blue);
    margin: 0;
}

.emi-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: var(--emi-light-gray);
    color: var(--emi-text-secondary);
    cursor: pointer;
    transition: var(--emi-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.emi-modal-close:hover {
    background: var(--emi-error-red);
    color: var(--emi-white);
}

.emi-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* Breakdown Table */
.emi-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.emi-breakdown-table thead {
    background: var(--emi-primary-blue);
    color: var(--emi-white);
}

.emi-breakdown-table th {
    padding: 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emi-breakdown-table tbody tr {
    border-bottom: 1px solid var(--emi-border-gray);
}

.emi-breakdown-table tbody tr:hover {
    background: var(--emi-light-gray);
}

.emi-breakdown-table td {
    padding: 10px;
    font-size: 12px;
}

.emi-breakdown-table td:first-child {
    font-weight: 600;
    color: var(--emi-text-secondary);
}

/* ========== INFORMATION SECTION ========== */
.emi-info-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8f9fb 0%, white 100%);
    border-top: 1px solid var(--emi-border-gray);
}

/* Section Title for Info Section */
.emi-section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--emi-primary-blue);
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.emi-section-title i {
    color: var(--emi-primary-orange);
}

.emi-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 0;
}

.emi-info-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.emi-info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.emi-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.emi-info-header i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(243, 109, 33, 0.1), rgba(243, 109, 33, 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--emi-primary-orange);
    font-size: 18px;
}

.emi-info-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--emi-primary-blue);
    margin: 0;
}

.emi-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.emi-info-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: var(--emi-text-secondary);
    line-height: 1.6;
}

.emi-info-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--emi-success-green);
    font-weight: 600;
    font-size: 14px;
}

.emi-info-content {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: var(--emi-text-secondary);
    line-height: 1.6;
}

.emi-info-content p {
    margin-bottom: 12px;
}

.emi-info-content p strong {
    color: var(--emi-primary-blue);
    font-weight: 600;
}

/* Formula Box */
.emi-formula {
    margin-top: 15px;
    padding: 15px;
    background: var(--emi-light-gray);
    border-radius: 8px;
    border-left: 3px solid var(--emi-primary-orange);
}

.emi-formula p {
    margin-bottom: 8px;
    color: var(--emi-text-primary);
}

.emi-formula p strong {
    color: var(--emi-primary-blue);
}

.emi-formula code {
    display: block;
    padding: 12px;
    background: white;
    border-radius: 6px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    color: var(--emi-primary-blue);
    font-size: 13px;
    white-space: pre-wrap;
    border: 1px solid var(--emi-border-gray);
}

.emi-formula-note {
    font-size: 12px;
    color: var(--emi-text-secondary);
    font-style: italic;
    margin-top: 5px;
}

/* FAQs */
.emi-faqs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.emi-faq {
    border: 1px solid var(--emi-border-gray);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    list-style: none;
}

.emi-faq[open] {
    border-color: var(--emi-primary-orange);
    box-shadow: 0 2px 8px rgba(243, 109, 33, 0.1);
}

.emi-faq summary {
    padding: 12px 15px;
    background: var(--emi-light-gray);
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--emi-text-primary);
    transition: all 0.3s ease;
    position: relative;
    padding-left: 35px;
    user-select: none;
    list-style: none;
}

.emi-faq summary::-webkit-details-marker {
    display: none;
}

.emi-faq summary::before {
    content: '▶';
    position: absolute;
    left: 15px;
    color: var(--emi-primary-orange);
    transition: transform 0.3s ease;
    font-size: 12px;
}

.emi-faq[open] summary::before {
    transform: rotate(90deg);
}

.emi-faq summary:hover {
    background: rgba(243, 109, 33, 0.05);
}

.emi-faq[open] summary {
    background: var(--emi-primary-orange);
    color: white;
}

.emi-faq[open] summary::before {
    color: white;
}

.emi-faq p {
    padding: 15px;
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: var(--emi-text-secondary);
    line-height: 1.6;
    background: white;
}

/* ========== GUIDE SECTION ========== */
.emi-guide-section {
    padding: 60px 0;
    background: #f8f9fb;
    border-top: 1px solid var(--emi-border-gray);
}

.emi-guide-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.emi-guide-header {
    text-align: center;
    margin-bottom: 30px;
}

.emi-guide-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--emi-primary-blue);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.emi-guide-title i {
    color: var(--emi-primary-orange);
    font-size: 1.8rem;
}

.emi-guide-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.1rem;
    color: var(--emi-text-secondary);
}

.emi-guide-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

.emi-guide-container {
    height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--emi-border-gray);
    border-radius: 8px;
    position: relative;
}

/* Custom Scrollbar */
.emi-guide-container::-webkit-scrollbar {
    width: 8px;
}

.emi-guide-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.emi-guide-container::-webkit-scrollbar-thumb {
    background: var(--emi-primary-orange);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.emi-guide-container::-webkit-scrollbar-thumb:hover {
    background: #d55a1a;
}

/* Guide Loading/Error States */
.emi-guide-loading,
.emi-guide-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--emi-text-secondary);
    text-align: center;
}

.emi-guide-loading i {
    font-size: 2rem;
    color: var(--emi-primary-orange);
    margin-bottom: 15px;
}

.emi-guide-error i {
    font-size: 3rem;
    color: var(--emi-error-red);
    margin-bottom: 20px;
}

.emi-guide-loading p,
.emi-guide-error p {
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
}

.emi-guide-error h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: var(--emi-primary-blue);
    margin-bottom: 10px;
}

.emi-retry-btn {
    padding: 10px 20px;
    background: var(--emi-primary-orange);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 15px;
    transition: var(--emi-transition);
}

.emi-retry-btn:hover {
    background: #d55a1a;
    transform: translateY(-2px);
}

/* Guide Content Styles */
.emi-guide-container h1,
.emi-guide-container h2,
.emi-guide-container h3,
.emi-guide-container h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--emi-primary-blue);
    margin-top: 25px;
    margin-bottom: 15px;
}

.emi-guide-container h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--emi-primary-orange);
    padding-bottom: 10px;
}

.emi-guide-container h2 {
    font-size: 1.5rem;
}

.emi-guide-container h3 {
    font-size: 1.3rem;
    color: #4a5fc1;
}

.emi-guide-container p {
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.8;
    margin-bottom: 15px;
}

.emi-guide-container ul,
.emi-guide-container ol {
    font-family: 'Open Sans', sans-serif;
    color: #4b5563;
    margin-left: 25px;
    margin-bottom: 15px;
    line-height: 1.8;
}

.emi-guide-container li {
    margin-bottom: 8px;
}

.emi-guide-container strong {
    color: var(--emi-primary-blue);
    font-weight: 600;
}

.emi-guide-container blockquote {
    border-left: 4px solid var(--emi-primary-orange);
    padding: 15px 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--emi-text-secondary);
    background: #fef5f1;
    border-radius: 0 8px 8px 0;
}

.emi-guide-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.emi-guide-container th {
    background: var(--emi-primary-blue);
    color: white;
    padding: 12px;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
}

.emi-guide-container td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--emi-border-gray);
}

.emi-guide-container tr:hover {
    background: var(--emi-light-gray);
}

/* Notification Toast */
.emi-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--emi-success-green);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

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

/* Tablets */
@media (max-width: 1024px) {
    .emi-hero { padding: 40px 0 30px; }
    
    .emi-calculator-wrapper {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .emi-input-panel {
        min-height: 400px;
    }
    
    .emi-results-panel {
        border-left: none;
        border-top: 2px solid var(--emi-primary-orange);
        min-height: 380px;
        height: auto;
    }
    
    .emi-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .emi-info-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .emi-guide-container {
        height: 500px;
    }
    
    .emi-section-title {
        font-size: 1.6rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .emi-hero {
        padding: 30px 0 20px;
    }
    
    .emi-hero-title {
        font-size: 2rem;
    }
    
    .emi-main-section {
        padding: 20px 0;
    }
    
    .emi-input-panel,
    .emi-results-panel {
        padding: 15px;
    }
    
    /* Mobile Tab Styles */
    .emi-tab-text {
        display: none !important;
    }
    
    .emi-tabs {
        justify-content: space-between;
        gap: 10px !important;
    }
    
    .emi-tab {
        height: 44px;
        padding: 12px 0 !important;
    }
    
    .emi-tab-number {
        width: auto !important;
        height: auto !important;
        line-height: normal !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        background: transparent !important;
    }
    
    /* Stack form elements */
    .emi-form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .emi-form-label {
        flex: none;
        width: 100%;
    }
    
    .emi-result-amount {
        font-size: 1.3rem;
    }
    
    .emi-actions {
        flex-direction: column;
    }
    
    .emi-panel-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .emi-footer-buttons {
        width: 100%;
    }
    
    .emi-back-btn,
    .emi-next-btn,
    .emi-calculate-btn,
    .emi-reset-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Info Section Mobile */
    .emi-info-section {
        padding: 30px 0;
    }
    
    .emi-info-card {
        padding: 20px;
    }
    
    .emi-info-header {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .emi-info-header i {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .emi-info-header h3 {
        font-size: 1rem;
    }
    
    .emi-info-list li {
        font-size: 13px;
        margin-bottom: 10px;
        padding-left: 20px;
    }
    
    .emi-info-content {
        font-size: 13px;
    }
    
    .emi-formula {
        padding: 12px;
    }
    
    .emi-formula code {
        font-size: 11px;
        padding: 10px;
    }
    
    .emi-faq summary {
        padding: 10px 12px 10px 30px;
        font-size: 13px;
    }
    
    .emi-faq summary::before {
        left: 12px;
        font-size: 11px;
    }
    
    .emi-faq p {
        padding: 12px;
        font-size: 13px;
    }
    
    /* Guide Mobile */
    .emi-guide-section {
        padding: 40px 0;
    }
    
    .emi-guide-title {
        font-size: 1.6rem;
    }
    
    .emi-guide-title i {
        font-size: 1.5rem;
    }
    
    .emi-guide-subtitle {
        font-size: 1rem;
    }
    
    .emi-guide-wrapper {
        padding: 15px;
    }
    
    .emi-guide-container {
        height: 450px;
        padding: 15px;
    }
    
    .emi-guide-container h1 {
        font-size: 1.5rem;
    }
    
    .emi-guide-container h2 {
        font-size: 1.3rem;
    }
    
    .emi-section-title {
        font-size: 1.4rem;
        flex-direction: column;
        gap: 8px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .emi-container {
        padding: 0 10px;
    }
    
    .emi-hero {
        padding: 25px 0 15px;
    }
    
    .emi-hero-title {
        font-size: 1.75rem;
    }
    
    .emi-calculator-wrapper {
        border-radius: 8px;
    }
    
    .emi-input-panel,
    .emi-results-panel {
        padding: 12px;
    }
    
    .emi-form-group {
        margin-bottom: 14px;
    }
    
    .emi-input-wrapper {
        height: 34px;
    }
    
    .emi-input {
        font-size: 13px;
    }
    
    .emi-prefix,
    .emi-suffix {
        font-size: 12px;
        padding: 0 8px;
    }
    
    .emi-tabs {
        gap: 8px !important;
        padding: 3px;
    }
    
    .emi-tab {
        height: 40px;
        padding: 10px 0 !important;
    }
    
    .emi-tab-number {
        font-size: 15px !important;
    }
    
    /* Info Section Small Mobile */
    .emi-info-section {
        padding: 25px 0;
    }
    
    .emi-info-cards {
        gap: 15px;
    }
    
    .emi-info-card {
        padding: 15px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .emi-info-header {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .emi-info-header i {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .emi-info-header h3 {
        font-size: 0.95rem;
    }
    
    .emi-info-list li {
        font-size: 12px;
        margin-bottom: 8px;
        padding-left: 18px;
    }
    
    .emi-info-list li::before {
        font-size: 12px;
    }
    
    .emi-info-content {
        font-size: 12px;
    }
    
    .emi-info-content p {
        margin-bottom: 10px;
    }
    
    .emi-formula {
        padding: 10px;
        margin-top: 12px;
    }
    
    .emi-formula code {
        font-size: 10px;
        padding: 8px;
    }
    
    .emi-formula-note {
        font-size: 11px;
    }
    
    .emi-faq summary {
        padding: 8px 10px 8px 28px;
        font-size: 12px;
    }
    
    .emi-faq summary::before {
        left: 10px;
        font-size: 10px;
    }
    
    .emi-faq p {
        padding: 10px;
        font-size: 12px;
        line-height: 1.5;
    }
    
    /* Guide Small Mobile */
    .emi-guide-section {
        padding: 30px 0;
    }
    
    .emi-guide-title {
        font-size: 1.4rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .emi-guide-container {
        height: 400px;
        padding: 12px;
    }
    
    .emi-guide-container p,
    .emi-guide-container li {
        font-size: 0.9rem;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    .emi-hero {
        background: white;
        padding: 20px 0;
    }
    
    .emi-hero,
    .emi-input-panel,
    .emi-actions,
    .emi-modal {
        display: none !important;
    }
    
    .emi-calculator-wrapper {
        display: block;
        box-shadow: none;
        height: auto;
    }
    
    .emi-results-panel {
        border: none;
        background: white;
        padding: 0;
        height: auto;
    }
    
    .emi-info-section {
        page-break-before: always;
        padding: 20px 0;
    }
    
    .emi-info-cards {
        display: block;
    }
    
    .emi-info-card {
        page-break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid var(--emi-border-gray);
    }
    
    .emi-info-header i {
        display: none;
    }
    
    .emi-faq[open] summary {
        background: var(--emi-light-gray);
        color: var(--emi-text-primary);
    }
    
    .emi-guide-container {
        height: auto;
        overflow: visible;
        border: none;
    }
    
    /* Hide animations for print */
    .lazy-fade,
    .lazy-scale,
    .lazy-section {
        opacity: 1 !important;
        transform: none !important;
    }
}