/* TJAR Authentication Styles */

:root {
    --color-teal: #17a2b8;
    --color-teal-dark: #117a8b;
    --color-emerald: #10b981;
    --color-emerald-dark: #059669;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-red-500: #ef4444;
    --color-red-600: #dc2626;
    --color-green-500: #22c55e;
    --color-green-600: #16a34a;
}

/* Global Authentication Page Styles */
body[dir="rtl"] .auth-container {
    direction: rtl;
    text-align: right;
}

/* Input Styling */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea {
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

/* OTP Input Specific Styling */
.otp-input {
    background-color: white;
    border: 2px solid var(--color-gray-300);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.otp-input:focus {
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.otp-input:disabled {
    background-color: var(--color-gray-100);
    color: var(--color-gray-500);
    cursor: not-allowed;
}

/* Button Styling */
button[type="submit"] {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(23, 162, 184, 0.2);
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* Gradient Button */
.btn-gradient {
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-emerald) 100%);
    color: white;
    border: none;
    cursor: pointer;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, var(--color-teal-dark) 0%, var(--color-emerald-dark) 100%);
}

/* Checkbox Styling */
input[type="checkbox"] {
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-teal);
}

/* Error Messages */
.error-message {
    color: var(--color-red-500);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message::before {
    content: "⚠";
    font-size: 1.2rem;
}

/* Success Messages */
.success-message {
    color: var(--color-green-600);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-message::before {
    content: "✓";
    font-size: 1.2rem;
}

/* Form Container Spacing */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Required Field Indicator */
.required::after {
    content: "*";
    color: var(--color-red-500);
    margin: 0 0.25rem;
}

/* Phone Input Prefix */
.phone-prefix {
    background-color: var(--color-gray-50);
    padding: 0.75rem 1rem;
    border-right: 2px solid var(--color-gray-300);
    font-weight: 600;
    color: var(--color-gray-700);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .auth-left-section {
        display: none !important;
    }
    
    .auth-form-section {
        padding: 2rem 1.5rem !important;
    }
}

/* Animation Classes */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.auth-container {
    animation: slideInUp 0.5s ease-out;
}

.auth-header {
    animation: slideInDown 0.5s ease-out;
}

/* Link Styling */
a {
    color: var(--color-teal);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--color-teal-dark);
    text-decoration: underline;
}

/* Eye Icon Button */
button[type="button"][onclick*="togglePassword"] {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.spinner {
    border: 2px solid var(--color-gray-200);
    border-top: 2px solid var(--color-teal);
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    animation: spin 0.8s linear infinite;
}

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

/* Form Grid Layout */
.form-grid {
    display: grid;
    gap: 1.5rem;
}

.form-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--color-gray-200);
    margin: 1.5rem 0;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-primary {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--color-teal);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-emerald);
}

.badge-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-red-500);
}

/* Alert Box */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #ecfdf5;
    border-color: #d1fae5;
    color: #065f46;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fee2e2;
    color: #7f1d1d;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
}

/* RTL Specific Adjustments */
[dir="rtl"] .phone-prefix {
    border-right: none;
    border-left: 2px solid var(--color-gray-300);
}

[dir="rtl"] button[type="button"][onclick*="togglePassword"] {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .error-message,
[dir="rtl"] .success-message {
    flex-direction: row-reverse;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .auth-container {
        box-shadow: none;
    }
    
    button {
        display: none;
    }
}
