#loan-calculator-container {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-family: inherit;
    direction: rtl;
    text-align: right;
}

#loan-calculator-container h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
}

#loan-form label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
    color: #34495e;
}

#loan-form input, #loan-form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    text-align: left; /* برای اعداد */
}

#loan-form input[type="number"] {
    direction: ltr;
}

#loan-form button {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

#loan-form button:hover {
    background: #2980b9;
}

#results {
    margin-top: 20px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 5px;
    border-left: 4px solid #27ae60;
}

#results h3 {
    color: #27ae60;
    margin-bottom: 10px;
}

#results p {
    margin: 8px 0;
    font-size: 16px;
    font-weight: bold;
}

#results span {
    color: #e74c3c;
    font-size: 18px;
}

/* موبایل */
@media (max-width: 600px) {
    #loan-calculator-container {
        margin: -17px;
        padding: 15px;
    }
}
.error-msg {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}
/* انیمیشن دکمه */
#calc-btn {
    position: relative;
    overflow: hidden;
}

#calc-btn.loading {
    background: #3498db;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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

/* نتایج خاص */
#results {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    border-left: 4px solid #28a745;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2);
}

#results-title {
    color: #155724;
    font-size: 20px;
    margin-bottom: 15px;
    text-align: center;
    background: rgba(40, 167, 69, 0.1);
    padding: 10px;
    border-radius: 5px;
}

#results p {
    background: white;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    border-right: 3px solid #28a745;
}

#results span {
    color: #dc3545;
    font-size: 20px;
    font-weight: bold;
}

/* hover بهتر */
#loan-form input:focus, #loan-form select:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* select راست‌چین */
#mode {
    text-align: right;
    direction: rtl;
}

/* راهنما */
.text-guide {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 10px;
    font-style: italic;
}

/* موبایل پیشرفته */
@media (max-width: 600px) {
    #loan-calculator-container {
        margin: -17px;
        padding: 15px;
        font-size: 14px;
    }
    
    #loan-form input, #loan-form select, #loan-form button {
        font-size: 16px; /* zoom جلوگیری */
        padding: 12px;
    }
    
    #mode option {
        text-align: right;
        padding-right: 20px; /* فضای آیکون */
    }
    
    .text-guide {
        font-size: 11px;
        text-align: right;
    }
    
    #results p {
        font-size: 13px;
    }
    
    #results span {
        font-size: 14px;
    }
}

/* focus placeholder */
input:focus::placeholder {
    opacity: 0;
}