/* ==================== General Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #189890;
    --secondary-color: #229799;
    --accent-color: #48cfcb;
    --text-color: #424242;
    --text-light: #666;
    --bg-color: #ffffff;
    --bg-light: #f5f5f5;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
    color: var(--text-color);
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8f5f4 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== Auth Header ==================== */
.auth-header {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.auth-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-header .logo {
    text-decoration: none;
    transition: all 0.3s;
}

.auth-header .logo:hover {
    transform: scale(1.05);
}

.auth-header .logo h1 {
    font-size: 28px;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.auth-header .logo:hover h1 {
    color: var(--secondary-color);
}

.auth-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.auth-link:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* ==================== Main Content ==================== */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 40px 0;
}

.auth-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* ==================== Auth Card ==================== */
.auth-card {
    background-color: var(--bg-color);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.auth-header-content {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header-content h2 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.auth-header-content p {
    color: var(--text-light);
    font-size: 16px;
}

/* ==================== User Type Selector ==================== */
.user-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.type-btn i {
    font-size: 32px;
    color: var(--text-light);
    transition: all 0.3s;
}

.type-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(72, 207, 203, 0.05);
}

.type-btn.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(72, 207, 203, 0.1), rgba(34, 151, 153, 0.1));
    color: var(--primary-color);
}

.type-btn.active i {
    color: var(--primary-color);
}

/* ==================== Form Styles ==================== */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 14px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background-color: var(--bg-color);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(72, 207, 203, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 13px;
}

/* ==================== Form Row ==================== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ==================== Password Input ==================== */
.password-input {
    position: relative;
}

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

.toggle-password {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* ==================== Address Group ==================== */
.address-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.address-group select,
.address-group input {
    width: 100%;
}

.address-group input:last-child {
    grid-column: 1 / -1;
}

/* ==================== File Input ==================== */
.file-input {
    position: relative;
}

.file-input input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background-color: var(--bg-light);
}

.file-label:hover {
    border-color: var(--primary-color);
    background-color: rgba(72, 207, 203, 0.05);
}

.file-label i {
    font-size: 32px;
    color: var(--primary-color);
}

.file-label span {
    color: var(--text-light);
    font-size: 14px;
}

.file-preview {
    margin-top: 15px;
    text-align: center;
}

.file-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* ==================== Checkbox ==================== */
.checkbox-group {
    margin: 25px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ==================== Submit Button ==================== */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(72, 207, 203, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 207, 203, 0.4);
}

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

/* ==================== Form Options ==================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    font-size: 14px;
}

.remember-me {
    margin: 0;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

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

/* ==================== Divider ==================== */
.divider {
    position: relative;
    text-align: center;
    margin: 30px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.divider span {
    position: relative;
    background-color: var(--bg-color);
    padding: 0 15px;
    color: var(--text-light);
    font-size: 14px;
}

/* ==================== Social Login ==================== */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.social-btn.google {
    color: #db4437;
}

.social-btn.google:hover {
    border-color: #db4437;
    background-color: rgba(219, 68, 55, 0.05);
}

.social-btn.facebook {
    color: #4267B2;
}

.social-btn.facebook:hover {
    border-color: #4267B2;
    background-color: rgba(66, 103, 178, 0.05);
}

/* ==================== Auth Footer ==================== */
.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-light);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ==================== Login Features ==================== */
.login-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background-color: var(--bg-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    font-size: 28px;
    color: white;
}

.feature-card h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}

/* ==================== Footer Section ==================== */
.auth-footer-section {
    background-color: var(--text-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
}

.auth-footer-section p {
    margin: 0;
    font-size: 14px;
}

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

    .auth-header-content h2 {
        font-size: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .address-group {
        grid-template-columns: 1fr;
    }

    .address-group input:last-child {
        grid-column: 1;
    }

    .user-type-selector {
        grid-template-columns: 1fr;
    }

    .login-features {
        grid-template-columns: 1fr;
    }

    .form-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .auth-header .logo h1 {
        font-size: 22px;
    }

    .auth-link {
        font-size: 14px;
        padding: 8px 15px;
    }

    .auth-card {
        padding: 25px 15px;
    }

    .type-btn {
        padding: 15px;
    }

    .type-btn i {
        font-size: 24px;
    }
}

/* ==================== Login Card Specific ==================== */
.login-card {
    max-width: 500px;
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeIn 0.5s ease;
}

/* ==================== Loading State ==================== */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 10px;
}

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

/* ==================== Success/Error Messages ==================== */
.message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.message.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.message.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.message i {
    font-size: 18px;
}

/* ==================== New Auth Message Styles ==================== */
.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.auth-message--success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #1a7a30;
    border: 1px solid #28a745;
}

.auth-message--error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #c0392b;
    border: 1px solid #dc3545;
}

.auth-message--info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c7a8a;
    border: 1px solid #17a2b8;
}

.auth-message--warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border: 1px solid #ffc107;
}

.auth-message i {
    font-size: 17px;
    flex-shrink: 0;
}

/* ==================== Input Error Highlight ==================== */
.input-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* ==================== Forgot Password Modal ==================== */
.forgot-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.forgot-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.forgot-modal {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.25s ease;
}

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

.forgot-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.forgot-modal__header h3 {
    font-size: 20px;
    color: var(--primary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.forgot-modal__close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.forgot-modal__close:hover {
    background: #f0f0f0;
    color: var(--text-color);
}

.forgot-modal__hint {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

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

.forgot-ok {
    color: #1a7a30;
    background: rgba(40,167,69,0.08);
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.forgot-err {
    color: #c0392b;
    background: rgba(220,53,69,0.08);
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 12px;
}
