/* Auth Pages Styles - Login, Register, Forgot Password, etc. */

.login-page-wrapper {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 15px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    padding: 35px 25px;
    max-width: 400px;
    width: 100%;
}

.login-header {
    margin-bottom: 28px;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #3f4064;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 13px;
    color: #81858b;
}

.form-group-login {
    margin-bottom: 18px;
}

.form-group-login label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #424750;
    margin-bottom: 6px;
}

.form-control-login {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1.5px solid #dfe0e4;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #fff;
    color: #3f4064;
    font-family: iranyekan;
}

.form-control-login::placeholder {
    color: #a1a3a8;
    font-size: 13px;
}

.form-control-login:focus {
    outline: none;
    border-color: var(--primary-color, #1e65b1);
    box-shadow: 0 0 0 3px rgba(30, 101, 177, 0.08);
}

.form-control-login.is-invalid {
    border-color: #ef394e;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-left: 45px;
}

.password-toggle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--primary-color, #1e65b1);
}

.password-toggle i {
    font-size: 18px;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
}

.remember-me input[type='checkbox'] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color, #1e65b1);
}

.remember-me label {
    color: #424750;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
    margin: 0;
}

.forgot-password {
    color: var(--primary-color, #1e65b1);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: var(--primary-color, #1e65b1);
    color: #fff;
    border: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: iranyekan;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 101, 177, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    position: relative;
    background: #f5f5f5;
    padding: 0 12px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
}

.external-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #6b7280;
}

.external-link a {
    color: var(--primary-color, #1e65b1);
    text-decoration: none;
    font-weight: 600;
    margin-right: 4px;
}

.external-link a:hover {
    text-decoration: underline;
}

.terms-text {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 16px;
    line-height: 1.7;
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.captcha-input {
    flex: 1;
}

.captcha-image {
    width: 120px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.captcha-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Register Page Styles */
.register-card {
    max-width: 800px;
    padding: 40px 35px;
}

.person-type-section {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 25px;
}

.radio-group-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-group-wrapper input[type='radio'] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color, #1e65b1);
}

.radio-group-wrapper label {
    color: #424750;
    cursor: pointer;
    font-weight: 500;
    margin: 0;
    user-select: none;
}

.form-section {
    margin-bottom: 25px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-bottom: 2px solid var(--primary-color, #1e65b1);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #3f4064;
    margin: 0;
}

.section-content {
    padding: 25px 20px;
}

.form-section .row {
    margin-left: -10px;
    margin-right: -10px;
}

.form-section .row > div {
    padding-left: 10px;
    padding-right: 10px;
}

.form-section textarea.form-control-login {
    resize: vertical;
    min-height: 100px;
}

.form-section select.form-control-login {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 16px 12px;
    padding-left: 40px;
    appearance: none;
}

/* Custom Dropdown Styling */
.form-section .custom-dropdown {
    position: relative;
    width: 100%;
}

.form-section .custom-dropdown .custom-dropdown-toggle {
    width: 100%;
    padding: 12px 14px;
    padding-left: 40px;
    font-size: 14px;
    border: 1.5px solid #dfe0e4;
    border-radius: 8px;
    background-color: #fff;
    color: #3f4064;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
}

.form-section .custom-dropdown .custom-dropdown-toggle:hover {
    border-color: var(--primary-color, #1e65b1);
}

.form-section .custom-dropdown.active .custom-dropdown-toggle {
    border-color: var(--primary-color, #1e65b1);
    box-shadow: 0 0 0 3px rgba(30, 101, 177, 0.08);
}

.form-section .custom-dropdown .custom-dropdown-toggle i {
    font-size: 20px;
    color: #9ca3af;
    position: absolute;
    left: 12px;
    transition: transform 0.2s ease;
}

.form-section .custom-dropdown.active .custom-dropdown-toggle i {
    transform: rotate(180deg);
}

.form-section .custom-dropdown .custom-dropdown-text {
    flex: 1;
    text-align: right;
    direction: rtl;
}

.form-section .custom-dropdown .custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background: #fff;
    border: 1.5px solid #dfe0e4;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    display: none;
    flex-direction: column;
}

.form-section .custom-dropdown.active .custom-dropdown-menu {
    display: flex;
}

.form-section .custom-dropdown .custom-dropdown-search {
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    direction: rtl;
    text-align: right;
    outline: none;
}

.form-section .custom-dropdown .custom-dropdown-search:focus {
    border-color: var(--primary-color, #1e65b1);
}

.form-section .custom-dropdown .custom-dropdown-search::placeholder {
    color: #a1a3a8;
}

.form-section .custom-dropdown .custom-dropdown-options {
    max-height: 240px;
    overflow-y: auto;
    direction: rtl;
}

.form-section .custom-dropdown .custom-dropdown-option {
    padding: 10px 14px;
    font-size: 14px;
    color: #424750;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
}

.form-section .custom-dropdown .custom-dropdown-option:hover {
    background-color: rgba(30, 101, 177, 0.08);
    color: var(--primary-color, #1e65b1);
}

.form-section .custom-dropdown .custom-dropdown-option.selected {
    background-color: rgba(30, 101, 177, 0.12);
    color: var(--primary-color, #1e65b1);
    font-weight: 600;
}

.form-section .custom-dropdown .custom-dropdown-option.hidden {
    display: none;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .register-card {
        padding: 30px 20px;
    }

    .person-type-section {
        flex-direction: column;
        gap: 12px;
    }

    .section-header {
        padding: 12px 15px;
    }

    .section-content {
        padding: 20px 15px;
    }
}

@media (max-width: 576px) {
    .login-page-wrapper {
        padding: 25px 12px;
        min-height: unset;
    }

    .login-card {
        padding: 30px 24px;
    }

    .register-card {
        padding: 25px 18px;
    }

    .login-title {
        font-size: 19px;
    }

    .form-group-login {
        margin-bottom: 16px;
    }

    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 18px;
    }

    .captcha-row {
        flex-direction: column;
        gap: 10px;
    }

    .captcha-image {
        width: 100%;
    }

    .form-section .row > div {
        margin-bottom: 10px;
    }
}

/* Login Loader Styles */
.login-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 12px;
}

.login-loader-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--primary-color, #1e65b1);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
    border-top-color: var(--primary-color, #1e65b1);
    opacity: 1;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: rgba(30, 101, 177, 0.7);
    opacity: 0.8;
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: rgba(30, 101, 177, 0.5);
    opacity: 0.6;
}

.spinner-ring:nth-child(4) {
    border-top-color: rgba(30, 101, 177, 0.3);
    opacity: 0.4;
}

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

.loader-text {
    color: var(--primary-color, #1e65b1);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.btn-loader {
    display: inline-flex;
    align-items: center;
}

.btn-loader i {
    font-size: 18px;
    animation: spin 1s linear infinite;
}
