/**
 * Central Auth System - Styles
 * Version: 1.0.0
 */

/* ==========================================
   متغیرهای CSS
========================================== */
:root {
    --ca-primary: #667eea;
    --ca-primary-dark: #5568d3;
    --ca-success: #10b981;
    --ca-error: #ef4444;
    --ca-warning: #f59e0b;
    --ca-text: #1f2937;
    --ca-text-light: #6b7280;
    --ca-border: #e5e7eb;
    --ca-bg: #ffffff;
    --ca-bg-light: #f9fafb;
    --ca-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --ca-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --ca-radius: 8px;
    --ca-transition: all 0.3s ease;
}

/* ==========================================
   Container اصلی
========================================== */
.central-auth-container {
    width: 100%;
    max-width: 420px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
}

.central-auth-box {
    background: var(--ca-bg);
    border-radius: var(--ca-radius);
    box-shadow: var(--ca-shadow-lg);
    overflow: hidden;
}

/* ==========================================
   هدر
========================================== */
.central-auth-header {
    padding: 30px 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--ca-primary) 0%, var(--ca-primary-dark) 100%);
    color: white;
}

.central-auth-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
}

.central-auth-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* ==========================================
   پیام‌ها
========================================== */
.central-auth-messages {
    padding: 0 30px;
    margin-top: 20px;
}

.central-auth-message {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.central-auth-message-icon {
    margin-left: 10px;
    font-size: 18px;
}

.central-auth-error {
    background: #fee;
    color: var(--ca-error);
    border: 1px solid #fcc;
}

.central-auth-success {
    background: #efe;
    color: var(--ca-success);
    border: 1px solid #cfc;
}

/* ==========================================
   فرم‌ها
========================================== */
.central-auth-form-wrapper {
    padding: 30px;
}

.central-auth-form {
    width: 100%;
}

.central-auth-form-group {
    margin-bottom: 20px;
    position: relative;
}

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

.central-auth-input {
    width: 100%;
    padding: 14px 45px 14px 16px;
    font-size: 16px;
    border: 2px solid var(--ca-border);
    border-radius: 6px;
    transition: var(--ca-transition);
    box-sizing: border-box;
    font-family: inherit;
     color: #1f2937 !important;
    background-color: #ffffff !important;
}

.central-auth-input::placeholder {
    color: #9ca3af !important;
}

.central-auth-input:focus {
    outline: none;
    border-color: var(--ca-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.central-auth-input-icon {
    position: absolute;
    left: 16px;
    top: 42px;
    font-size: 20px;
}

/* ==========================================
   دکمه‌ها
========================================== */
.central-auth-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--ca-transition);
    position: relative;
    font-family: inherit;
}

.central-auth-btn-primary {
    background: linear-gradient(135deg, var(--ca-primary) 0%, var(--ca-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.central-auth-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.central-auth-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.central-auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.central-auth-btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   Spinner
========================================== */
.central-auth-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

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

/* ==========================================
   فیلدهای OTP
========================================== */
.central-auth-mobile-display {
    text-align: center;
    padding: 15px;
    background: var(--ca-bg-light);
    border-radius: 6px;
    margin-bottom: 20px;
}

.central-auth-mobile-display p {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--ca-text-light);
}

.central-auth-mobile-display strong {
    color: var(--ca-text);
    font-weight: 700;
}

.central-auth-change-mobile {
    background: none;
    border: none;
    color: var(--ca-primary);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-family: inherit;
}

.central-auth-change-mobile:hover {
    color: var(--ca-primary-dark);
}

.central-auth-otp-inputs {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    direction: ltr;
}

.central-auth-otp-digit {
    width: 100%;
    max-width: 60px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--ca-border);
    border-radius: 8px;
    transition: var(--ca-transition);
    font-family: 'Courier New', monospace;
}

.central-auth-otp-digit:focus {
    outline: none;
    border-color: var(--ca-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: scale(1.05);
}

/* ==========================================
   تایمر
========================================== */
.central-auth-timer-section {
    text-align: center;
    margin: 20px 0;
}

.central-auth-timer {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--ca-bg-light);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ca-text);
}

.central-auth-timer-icon {
    margin-left: 6px;
}

#central-auth-timer-text {
    font-family: 'Courier New', monospace;
    direction: ltr;
}

.central-auth-resend-btn {
    background: none;
    border: none;
    color: var(--ca-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    margin-top: 10px;
    font-family: inherit;
}

.central-auth-resend-btn:hover {
    text-decoration: underline;
}

/* ==========================================
   فوتر
========================================== */
.central-auth-footer {
    padding: 20px 30px;
    background: var(--ca-bg-light);
    text-align: center;
}

.central-auth-privacy {
    margin: 0;
    font-size: 13px;
    color: var(--ca-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.central-auth-lock-icon {
    margin-left: 6px;
}

/* ==========================================
   کاربر لاگین شده
========================================== */
.central-auth-logged-in {
    padding: 30px;
}

.central-auth-user-info {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 8px;
    color: white;
}

.central-auth-user-info h3 {
    margin: 0 0 10px;
    font-size: 20px;
}

.central-auth-user-info p {
    margin: 0 0 20px;
    font-size: 14px;
    opacity: 0.9;
}

.central-auth-logout-btn {
    display: inline-block;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--ca-transition);
}

.central-auth-logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   استایل Minimal
========================================== */
.central-auth-style-minimal .central-auth-box {
    box-shadow: none;
    border: 1px solid var(--ca-border);
}

.central-auth-style-minimal .central-auth-header {
    background: var(--ca-bg-light);
    color: var(--ca-text);
}

.central-auth-style-minimal .central-auth-form-wrapper {
    padding: 20px;
}

/* ==========================================
   استایل Modern
========================================== */
.central-auth-style-modern .central-auth-box {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.central-auth-style-modern .central-auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.central-auth-style-modern .central-auth-input {
    border-radius: 10px;
}

.central-auth-style-modern .central-auth-btn {
    border-radius: 10px;
}

/* ==========================================
   ویجت
========================================== */
.central-auth-widget-logged-in {
    padding: 15px;
    background: var(--ca-bg-light);
    border-radius: 6px;
    text-align: center;
}

.central-auth-widget-logged-in p {
    margin: 0 0 5px;
}

/* ==========================================
   Responsive
========================================== */
@media (max-width: 480px) {
    .central-auth-container {
        margin: 15px;
    }

    .central-auth-header {
        padding: 20px 20px 15px;
    }

    .central-auth-header h2 {
        font-size: 20px;
    }

    .central-auth-form-wrapper {
        padding: 20px;
    }

    .central-auth-otp-digit {
        max-width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .central-auth-otp-inputs {
        gap: 6px;
    }
}

/* ==========================================
   انیمیشن‌های اضافی
========================================== */
.central-auth-step {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   حالت تاریک (اختیاری)
========================================== */
@media (prefers-color-scheme: dark) {
    .central-auth-container {
        --ca-text: #f9fafb;
        --ca-text-light: #9ca3af;
        --ca-border: #374151;
        --ca-bg: #1f2937;
        --ca-bg-light: #111827;
    }
}