/* Installment Calculator - Compact RTL */
:root {
    --ic-primary: #fe6d41;
    --ic-primary-dark: #e85a2f;
    --ic-secondary: #1a1a2e;
    --ic-success: #10b981;
    --ic-gradient: linear-gradient(135deg, #fe6d41 0%, #f59e0b 100%);
    --ic-gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.installment-page {
    padding: 20px 0 20px;
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    direction: rtl;
    text-align: right;
}

.installment-page .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Remove underlines from all links */
.installment-page a {
    text-decoration: none !important;
}

.installment-page a:hover {
    text-decoration: none !important;
}

/* Header */
.page-header {
    background: var(--ic-gradient-dark);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #fff;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-icon img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.header-text {
    flex: 1;
}

.page-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 2px;
}

.page-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

/* Layout - Calculator right, info left - Equal Heights */
.installment-layout {
    display: grid;
    grid-template-columns: 440px 1fr;
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 992px) {
    .installment-layout {
        grid-template-columns: 1fr;
    }
    .info-columns { order: 2; }
    .calculator-section { order: 1; }
}

/* Calculator Section */
.calculator-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Info Columns - 2 columns side by side - Equal Heights */
.info-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;
}

.info-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-column .info-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.info-column .info-card .info-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .info-columns {
        grid-template-columns: 1fr;
    }
    .info-column .info-card {
        flex: none;
        height: auto;
    }
    .info-column .info-card .info-body {
        flex: none;
        height: auto;
    }
    .rules-list, .docs-list, .steps-list {
        height: auto;
        justify-content: flex-start;
    }
    .rules-list li, .docs-list li, .steps-list li {
        flex: none;
    }
}

/* Cards */
.calculator-card, .info-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.calculator-card {
    flex: 1;
}

.calculator-header, .info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--ic-gradient-dark);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.calculator-header i, .info-header i {
    color: var(--ic-primary);
}

.calculator-body, .info-body {
    padding: 16px;
}

/* Form */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--ic-secondary);
    font-size: 13px;
}

.form-group label i {
    color: var(--ic-primary);
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 12px 55px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ic-secondary);
    transition: all 0.2s;
    direction: ltr;
    text-align: center !important;
    font-family: 'Vazir', 'IRANSans', Tahoma, sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--ic-primary);
    box-shadow: 0 0 0 3px rgba(254,109,65,0.1);
    text-align: center !important;
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
    font-size: 13px;
    text-align: center;
    font-family: 'Vazir', 'IRANSans', Tahoma, sans-serif;
}

.input-suffix {
    position: absolute;
    left: 12px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

/* Quick Select */
.quick-select {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.quick-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    border-color: var(--ic-primary);
    color: var(--ic-primary);
}

.quick-btn.active {
    background: var(--ic-primary);
    border-color: var(--ic-primary);
    color: #fff;
}

/* Months Selector */
.months-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.month-btn {
    padding: 10px 6px;
    border: 2px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.month-btn:hover {
    border-color: var(--ic-primary);
    color: var(--ic-primary);
}

.month-btn.active {
    background: var(--ic-gradient);
    border-color: var(--ic-primary);
    color: #fff;
}

.months-selector.selector-error .month-btn {
    border-color: #dc2626;
    animation: shake 0.4s ease;
}

/* Calculate Button */
.calculate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--ic-gradient);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(254,109,65,0.3);
    margin-top: 6px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254,109,65,0.4);
}

/* Input Error */
.form-input.input-error {
    border-color: #dc2626;
    background: #fef2f2;
    animation: shake 0.4s ease;
}

.form-input.input-error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-error-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
}

.input-error-msg i {
    font-size: 12px;
}

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

/* Contact Box - Green (scoped to installment page) */
.installment-page .contact-box {
    margin-top: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 14px;
    padding: 16px;
    color: #fff;
}

.installment-page .contact-box-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 12px;
}

.installment-page .contact-box-title i {
    font-size: 20px;
}

.installment-page .contact-box-links {
    display: flex;
    gap: 10px;
}

.installment-page .contact-box .contact-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.installment-page .contact-box .contact-link:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
}

.installment-page .contact-box .contact-link.whatsapp {
    background: #25d366;
}

.installment-page .contact-box .contact-link.whatsapp:hover {
    background: #20bd5a;
}

.installment-page .contact-box .contact-link i {
    font-size: 18px;
}

/* Info Cards */
.rules-list, .docs-list, .steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.rules-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    flex: 1;
}

.rule-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #374151;
}

.rule-title i {
    color: var(--ic-success);
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.rule-value {
    font-weight: 700;
    color: var(--ic-primary);
}

.docs-list li, .steps-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    flex: 1;
}

.rules-list li:last-child, .docs-list li:last-child, .steps-list li:last-child {
    border-bottom: none;
}

.rules-list li i, .docs-list li i {
    color: var(--ic-success);
    font-size: 14px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.rules-list li strong, .docs-list li strong {
    color: var(--ic-primary);
}

/* Steps List */
.steps-list li {
    align-items: flex-start;
}

.step-number {
    width: 24px;
    height: 24px;
    background: var(--ic-gradient);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    line-height: 1.6;
}

/* Advantages */
.advantages-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.advantage-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 12px;
    color: #374151;
}

.advantage-item i {
    color: var(--ic-primary);
    font-size: 16px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    direction: rtl;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlide 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--ic-gradient-dark);
    color: #fff;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
}

.modal-title i {
    color: var(--ic-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
}

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

/* Summary Row */
.summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

@media (max-width: 480px) {
    .summary-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.summary-item {
    background: #f9fafb;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.summary-item.highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.summary-label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--ic-secondary);
}

/* Interest Row */
.interest-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 14px;
    background: #eff6ff;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #1e40af;
}

.interest-row i {
    margin-left: 4px;
}

.interest-row strong {
    font-weight: 800;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.installments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
}

.installments-table th {
    background: var(--ic-gradient-dark);
    color: #fff;
    padding: 10px 8px;
    font-weight: 600;
    white-space: nowrap;
}

.installments-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.installments-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.installments-table tbody tr:hover {
    background: #fef7f4;
}

.installments-table tfoot {
    background: #f3f4f6;
    font-weight: 700;
}

.installments-table tfoot td {
    border-bottom: none;
    color: var(--ic-secondary);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.btn-secondary, .btn-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-primary {
    background: var(--ic-success);
    color: #fff;
}

.btn-primary:hover {
    background: #059669;
    color: #fff;
}

/* Responsive */
@media (max-width: 576px) {
    .page-header { padding: 12px 14px; }
    .header-icon { width: 42px; height: 42px; }
    .header-icon img { width: 28px; height: 28px; }
    .page-title { font-size: 16px; }
    .calculator-body, .info-body { padding: 14px; }
    .months-selector { grid-template-columns: repeat(4, 1fr); }
    .modal-container { max-height: 95vh; }
    .advantages-grid { grid-template-columns: 1fr; }
    .contact-box-links { flex-direction: column; }
    
    /* Fix info cards on mobile */
    .info-column .info-card {
        flex: none;
        height: auto;
    }
    .info-column .info-card .info-body {
        flex: none;
        height: auto;
        padding-bottom: 20px;
    }
    .rules-list, .docs-list, .steps-list {
        height: auto;
        justify-content: flex-start;
    }
    .rules-list li, .docs-list li, .steps-list li {
        flex: none;
    }
}
