@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --primary-color: #377E4F;
    --primary-dark: #2a613d;
    --primary-light: #e8f5e9;
    --accent-color: #25D366;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px rgba(55, 126, 79, 0.15);
    --shadow-lg: 0 20px 40px rgba(55, 126, 79, 0.2);
    --radius: 16px;
    --error-color: #dc3545;
    --success-color: #198754;
    --warning-color: #ffc107;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
    color: var(--text-dark);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-dark);
}

.auth-navbar {
    background-color: var(--white) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 0;
}

.auth-navbar .navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.auth-navbar .nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
}

.auth-navbar .nav-link:hover {
    color: var(--primary-color) !important;
}

.auth-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.auth-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(55, 126, 79, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: -1;
    border-radius: 50%;
}

.auth-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    padding: 2.5rem;
    border: 1px solid rgba(55, 126, 79, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-gray);
    font-size: 0.95rem;
}

.trial-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.8rem;
}

.auth-form .form-group {
    margin-bottom: 1.2rem;
}

.auth-form .form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.95rem;
}

.auth-form .input-group {
    position: relative;
}

.auth-form .form-control {
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 12px 45px 12px 15px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fafafa;
}

.auth-form .form-control:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(55, 126, 79, 0.1);
    outline: none;
}

.auth-form .form-control.is-invalid {
    border-color: var(--error-color);
}

.auth-form .form-control.is-valid {
    border-color: var(--success-color);
}

.auth-form .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 1.1rem;
    transition: color 0.3s;
    z-index: 5;
}

.auth-form .form-control:focus+.input-icon {
    color: var(--primary-color);
}

.password-toggle {
    position: absolute;
    left: 45px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 0;
    z-index: 6;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.field-hint {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-gray);
    font-size: 0.82rem;
    font-weight: 500;
}

.password-strength {
    margin-top: 0.5rem;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    border-radius: 3px;
}

.strength-fill.weak {
    width: 33%;
    background: var(--error-color);
}

.strength-fill.medium {
    width: 66%;
    background: var(--warning-color);
}

.strength-fill.strong {
    width: 100%;
    background: var(--success-color);
}

.strength-text {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.strength-text.weak {
    color: var(--error-color);
}

.strength-text.medium {
    color: var(--warning-color);
}

.strength-text.strong {
    color: var(--success-color);
}

.terms-checkbox {
    margin: 1.5rem 0;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    color: var(--text-gray);
    cursor: pointer;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.form-check-label a {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(55, 126, 79, 0.4);
    color: white;
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    color: var(--text-gray);
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-footer a:hover {
    color: var(--primary-dark);
}

.alert-message {
    display: none;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.alert-message.show {
    display: block;
}

.alert-message.error {
    background: #fde8e8;
    color: var(--error-color);
    border: 1px solid #fcb6b6;
}

.alert-message.success {
    background: #d1fae5;
    color: var(--success-color);
    border: 1px solid #6ee7b7;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-page-footer {
    background: var(--white);
    border-top: 1px solid #eee;
    padding: 20px 0;
    text-align: center;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.auth-page-footer a {
    color: var(--primary-color);
    margin: 0 0.5rem;
}

@media (max-width: 768px) {
    .auth-container {
        padding: 2rem 1.5rem;
    }
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-btn.loading .loading-spinner {
    display: inline-block;
}

.auth-btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* زر اللغة */
.homepage-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s ease;
    cursor: pointer;
}

.homepage-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(55, 126, 79, 0.25);
    color: white;
}

.homepage-btn i {
    font-size: 1rem;
}