:root {
    --bg-color: #EBEBEC;
    --primary-color: #010133;
    --secondary-color: #002676;
    --accent-color: #FDB515;
    --dark-text: #000015;

    /* Font sizes for different devices */
    --font-size-mobile: 0.875rem;
    --font-size-tablet: 1rem;
    --font-size-desktop: 1.125rem;
}

* {
    font-family: 'Yekan Bakh Fa Num', sans-serif !important;
}

body {
    background-color: var(--bg-color);
    color: var(--dark-text);
    direction: rtl;
    text-align: right;
    font-weight: 500;
    font-size: var(--font-size-mobile);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Responsive font sizes */
@media (min-width: 768px) {
    body {
        font-size: var(--font-size-tablet);
    }
}

@media (min-width: 1200px) {
    body {
        font-size: var(--font-size-desktop);
    }
}

/* Custom utilities */
.fw-bold,
.fw-bolder {
    font-weight: 700 !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-accent {
    background-color: var(--accent-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 700;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-signup {
    background-color: transparent;
    border: 2px solid #002676;
    color: #002676;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-signup:hover,
.btn-outline-signup:focus {
    background-color: #002676;
    border-color: #002676;
    color: white;
}

/* Disabled button style */
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Checkbox styling */
.form-check {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0;
    cursor: pointer;
    border: 2px solid var(--secondary-color);
}

.form-check-input:checked {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1, 1, 51, 0.15);
}

.form-check-label {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--dark-text);
    user-select: none;
}

/* Login page specific styles */
.login-container {
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.login-form-section {
    background-color: var(--bg-color);
    padding: 1rem;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 1.5rem 1.5rem;
    max-width: 420px;
    width: 100%;
    margin: 0;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    direction: rtl;
}

.login-card::-webkit-scrollbar {
    display: none;
}

.login-image-section {
    background-color: #f8f9fa;
    background-image: linear-gradient(rgba(1, 1, 51, 0.7), rgba(1, 1, 51, 0.7)), url('../img/ss1.jpg');
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    margin: 0;
    padding: 0;
}



.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1, 1, 51, 0.25);
}

select.form-control {
    cursor: pointer;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23002676' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 12px;
    padding-left: 2.5rem;
}

select.form-control option {
    text-align: right;
    direction: rtl;
    font-size: 0.9rem;
    padding: 0.5rem;
}

.logo-container {
    max-width: 150px;
}

.forgot-password-link {
    font-size: 0.875rem;
    color: var(--primary-color) !important;
}

.forgot-password-link-gray {
    font-size: 0.75rem;
    color: #6c757d !important;
    transition: color 0.3s ease;
}

.divider-line {
    margin-top: 4px !important;

}

.forgot-password-link-gray:hover {
    color: var(--primary-color) !important;
}

.terms-link {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.terms-link:hover,
.terms-link:focus {
    color: var(--primary-color);
}

.signup-link {
    font-size: 1rem;
    color: var(--secondary-color) !important;
    font-weight: 600;
    transition: color 0.3s ease;
}

.signup-link:hover {
    color: var(--primary-color) !important;
}

.about-link {
    font-size: 0.85rem;
    color: #9e9e9e !important;
    transition: color 0.3s ease;
}

.about-link:hover {
    color: #010133 !important;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-separator {
    color: #d0d0d0;
    font-size: 0.85rem;
    user-select: none;
}

/* Validation styles */
.error-message {
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

/* Server error message styles (displayed below logo) */
.server-error-message {
    color: #dc3545;
    font-size: 0.8rem;
    text-align: center;
    padding: 0.5rem 0.75rem;
    margin: 0 auto 1rem auto;
    border: 1px solid #dc3545;
    border-radius: 8px;
    background-color: #fff5f5;
    max-width: 100%;
    display: block;
}

.server-success-message {
    color: #198754;
    font-size: 0.8rem;
    text-align: center;
    padding: 0.5rem 0.75rem;
    margin: 0 auto 1rem auto;
    border: 1px solid #198754;
    border-radius: 8px;
    background-color: #f0fff4;
    max-width: 100%;
    display: block;
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.terms-modal .modal-dialog {
    max-width: 720px;
    margin: 1.5rem auto;
}

.terms-modal .modal-content {
    border-radius: 16px;
}

.terms-modal .modal-header {
    direction: rtl;
    text-align: right;
    background-color: #f6f6f8;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.terms-modal .modal-title {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: right;
    color: var(--secondary-color);
}

.terms-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 0.95rem;
    text-align: justify;
    direction: rtl;
    scrollbar-width: thin;
    padding: 1.5rem;
}

.terms-modal .modal-body p {
    text-align: justify;
    margin-bottom: 0.75rem;
}

.terms-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.terms-modal .modal-body::-webkit-scrollbar-thumb {
    background-color: rgba(0, 38, 118, 0.4);
    border-radius: 999px;
}

.terms-modal .modal-body::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
}

.terms-modal .modal-body h6 {
    text-align: right;
    font-weight: 700;
}

.terms-modal .modal-body ul {
    padding-right: 1.25rem;
    text-align: right;
    direction: rtl;
}

.terms-modal .modal-body li {
    margin-bottom: 0.25rem;
    text-align: justify;
}

@media (max-width: 576px) {
    .terms-modal .modal-dialog {
        margin: 0.75rem;
    }
}

/* Desktop and tablet styles */
@media (min-width: 768px) {
    .login-image-section {
        min-height: 100vh;
        width: 50%;
    }

    .login-form-section {
        padding: 1rem;
        width: 50%;
    }

    .login-card {
        padding: 1.75rem 2rem;
        max-width: 90%;
    }
}

/* Large desktop styles */
@media (min-width: 1200px) {
    .login-image-section {
        background-attachment: fixed;
    }

    .login-card {
        padding: 2.5rem 3rem;
        max-width: 65%;
    }
}

/* Mobile styles */
@media (max-width: 767.98px) {
    .login-image-section {
        display: none !important;
    }

    .login-form-section {
        width: 100%;
        padding: 1rem;
    }

    .login-card {
        /* padding: 1.25rem 1rem; */
        padding: 2rem;
        margin: 1.25rem;
        border-radius: 16px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
        max-height: calc(100vh - 1rem);
    }

    .login-card .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    .login-card .mb-4 {
        margin-bottom: 1rem !important;
    }

    .logo-container {
        max-width: 140px;
    }
}

/* Registration tabs styles */
.registration-tabs .btn-group {
    border-radius: 8px;
    overflow: hidden;
}

.registration-tabs .btn {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
    font-weight: 600;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.registration-tabs .btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.registration-tabs .btn-check:checked+.btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.registration-tabs .btn-check:checked+.btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Registration form styles */
.registration-form {
    transition: all 0.3s ease;
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem;
        font-size: 0.875rem;
    }

    .form-control {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    .btn-lg {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }

    .logo-container {
        max-width: 125px;
    }

    .forgot-password-link {
        font-size: 0.75rem;
    }

    .registration-tabs .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* حذف فلش‌های کم و زیاد کردن از input عددی */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* کوچک کردن کپچا در موبایل */
@media (max-width: 768px) {
    .arcaptcha {
        transform: scale(0.85);
        transform-origin: center;
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .arcaptcha {
        transform: scale(0.8);
        transform-origin: center;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .arcaptcha {
        transform: scale(0.75);
        transform-origin: center;
        max-width: 100%;
    }
}