/* ===========================================
   نظام المصادقة والإعدادات - محافظة مسقط
   Auth & Settings System - Muscat Governorate
   =========================================== */

/* الألوان الرسمية */
:root {
    --primary-blue: #0E6F8E;
    --secondary-teal: #178C86;
    --accent-gold: #F2C318;
    --dark-gray: #2F4F5A;
    --light-bg: #F5F7FA;
    --white: #FFFFFF;
    --shadow: rgba(14, 111, 142, 0.1);
    --shadow-hover: rgba(14, 111, 142, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    direction: rtl;
    padding: 20px;
}

/* صفحة تسجيل الدخول */
.login-container {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
    animation: slideIn 0.5s ease-out;
}

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

.login-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    padding: 40px 30px;
    text-align: center;
    color: var(--white);
}

.login-header img {
    max-width: 120px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 16px;
    opacity: 0.95;
}

.login-body {
    padding: 40px 30px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-blue);
    font-size: 18px;
}

.form-control {
    width: 100%;
    padding: 14px 45px 14px 15px;
    border: 2px solid #E0E6ED;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Tajawal', Arial, sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--shadow);
}

.toggle-password {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 16px;
    transition: color 0.3s ease;
}

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

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

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

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

.remember-me label {
    font-size: 14px;
    color: var(--dark-gray);
    cursor: pointer;
    margin: 0;
}

.forgot-password {
    font-size: 14px;
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--secondary-teal);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-hover);
}

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

.btn-login i {
    margin-left: 8px;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.alert-danger {
    background-color: #FEE;
    color: #D00;
    border: 1px solid #FCC;
}

.alert-success {
    background-color: #EFE;
    color: #0A0;
    border: 1px solid #CFC;
}

.alert i {
    margin-left: 8px;
}

/* صفحة الإعدادات */
.settings-container {
    max-width: 900px;
    width: 100%;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.settings-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    padding: 30px;
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h1 {
    font-size: 26px;
    font-weight: 700;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.settings-body {
    padding: 30px;
}

.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #E0E6ED;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', Arial, sans-serif;
}

.tab-button.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

.tab-button:hover {
    color: var(--primary-blue);
}

.tab-button i {
    margin-left: 8px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 18px;
    color: var(--dark-gray);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section h3 i {
    color: var(--primary-blue);
}

.settings-card {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.btn-save {
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-hover);
}

.btn-save i {
    margin-left: 8px;
}

.btn-logout {
    padding: 12px 30px;
    background: #DC3545;
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #C82333;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
}

.btn-logout i {
    margin-left: 8px;
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    padding: 25px;
    border-radius: 12px;
    color: var(--white);
    margin-bottom: 30px;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.user-details h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.user-details p {
    font-size: 15px;
    opacity: 0.9;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    background: var(--accent-gold);
    color: var(--dark-gray);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container,
    .settings-container {
        max-width: 100%;
        border-radius: 10px;
    }

    .login-header,
    .settings-header {
        padding: 25px 20px;
    }

    .login-body,
    .settings-body {
        padding: 25px 20px;
    }

    .settings-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .settings-tabs {
        flex-wrap: wrap;
    }

    .tab-button {
        font-size: 14px;
        padding: 10px 15px;
    }

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

    .user-info-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

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

.btn-login.loading,
.btn-save.loading {
    pointer-events: none;
    opacity: 0.8;
}
