/* ═══════════════════════════════════════
   Zoon Auth — Login Styles
   RTL Arabic — v1.0.0
═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700&display=swap');

/* ─── Reset & Wrapper ─── */
.za-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: var(--za-font, 'Tajawal', sans-serif);
    direction: rtl;
}

/* ─── Card ─── */
.za-card {
    background: var(--za-card, #ffffff);
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.10);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    animation: za-fade-in 0.35s ease;
}

@keyframes za-fade-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Header ─── */
.za-header {
    text-align: center;
    margin-bottom: 28px;
}

.za-logo {
    max-height: 64px;
    max-width: 180px;
    margin-bottom: 16px;
    object-fit: contain;
}

.za-site-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--za-primary, #2563eb);
    margin-bottom: 12px;
}

.za-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--za-text, #1e293b) !important;
    margin: 0 0 8px !important;
    line-height: 1.4 !important;
}

.za-subtitle {
    font-size: 14px !important;
    color: #64748b !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

/* ─── Alert ─── */
.za-alert {
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

.za-alert.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.za-alert.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ─── Tabs (SMS / Email) ─── */
.za-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    gap: 4px;
}

.za-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--za-font, 'Tajawal', sans-serif);
}

.za-tab svg {
    width: 16px;
    height: 16px;
}

.za-tab.active {
    background: white;
    color: var(--za-primary, #2563eb);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ─── Field ─── */
.za-field {
    margin-bottom: 16px;
}

.za-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--za-text, #1e293b);
    margin-bottom: 8px;
}

.za-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: var(--za-text, #1e293b);
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: var(--za-font, 'Tajawal'), monospace;
    outline: none;
}

.za-input:focus {
    border-color: var(--za-primary, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--za-primary, #2563eb) 15%, transparent);
    background: #fff;
}

.za-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* ─── Button ─── */
.za-btn {
    width: 100%;
    padding: 14px;
    background: var(--za-primary, #2563eb);
    color: #fff !important;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    font-family: var(--za-font, 'Tajawal'), sans-serif;
    margin-top: 8px;
}

.za-btn:hover:not(:disabled) {
    background: var(--za-primary-dark, #1d4ed8) !important;
    transform: translateY(-1px);
}

.za-btn:active:not(:disabled) {
    transform: translateY(0);
}

.za-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ─── Spinner ─── */
.za-spin {
    width: 20px;
    height: 20px;
    animation: za-spin 0.8s linear infinite;
}

@keyframes za-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ─── OTP Hint ─── */
.za-otp-hint {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin: 0 0 20px;
    line-height: 1.6;
}

.za-otp-hint strong {
    color: var(--za-primary, #2563eb);
    direction: ltr;
    display: inline-block;
}

/* ─── OTP Digit Inputs ─── */
.za-otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.za-otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: var(--za-text, #1e293b);
    background: #f8fafc;
    transition: all 0.15s;
    outline: none;
    font-family: monospace;
}

.za-otp-digit:focus {
    border-color: var(--za-primary, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--za-primary, #2563eb) 15%, transparent);
    background: #fff;
}

.za-otp-digit.filled {
    border-color: var(--za-primary, #2563eb);
    background: color-mix(in srgb, var(--za-primary, #2563eb) 6%, white);
}

.za-otp-digit.error {
    border-color: #ef4444;
    background: #fef2f2;
    animation: za-shake 0.4s ease;
}

@keyframes za-shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-4px); }
    75%       { transform: translateX(4px); }
}

/* ─── Resend ─── */
.za-resend-wrap {
    text-align: center;
    margin-top: 16px;
}

.za-resend {
    background: none;
    border: none;
    color: var(--za-primary, #2563eb);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--za-font, 'Tajawal'), sans-serif;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.za-resend:hover:not(:disabled) {
    background: color-mix(in srgb, var(--za-primary, #2563eb) 8%, transparent);
}

.za-resend:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

#za-countdown {
    font-size: 13px;
    color: #94a3b8;
    margin-right: 4px;
}

/* ─── Back Button ─── */
.za-back {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    padding: 10px;
    margin-top: 8px;
    font-family: var(--za-font, 'Tajawal'), sans-serif;
    transition: color 0.2s;
    text-align: center;
}

.za-back:hover {
    color: var(--za-text, #1e293b);
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .za-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .za-otp-digit {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }

    .za-otp-inputs {
        gap: 7px;
    }
}

/* ═══════════════════════════════════════
   Registration Form Styles
═══════════════════════════════════════ */

/* ─── Registration Header ─── */
.za-reg-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.za-reg-badge {
    display: inline-block;
    background: var(--za-primary-light, #eff6ff);
    color: var(--za-primary, #2563eb);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.za-reg-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--za-text, #1e293b) !important;
    margin: 0 0 6px !important;
}

.za-reg-subtitle {
    font-size: 13px !important;
    color: #64748b !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

/* ─── Email Badge ─── */
.za-email-badge {
    display: inline-block;
    background: var(--za-primary-light, #eff6ff);
    color: var(--za-primary, #2563eb);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    direction: ltr;
    margin-top: 4px;
}

/* ─── Form Grid ─── */
.za-reg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}

.za-reg-field {
    margin-bottom: 14px;
}

.za-field-full {
    grid-column: 1 / -1;
}

/* ─── Required / Optional ─── */
.za-required {
    color: #ef4444;
    margin-right: 2px;
}

.za-optional {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 400;
    margin-right: 4px;
}

/* ─── Select ─── */
.za-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px !important;
    cursor: pointer;
}

/* ─── Phone Input ─── */
.za-phone-input {
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.za-phone-input:focus-within {
    border-color: var(--za-primary, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--za-primary, #2563eb) 15%, transparent);
    background: #fff;
}

.za-phone-prefix {
    padding: 13px 10px 13px 14px;
    font-size: 13px;
    color: #64748b;
    background: #f1f5f9;
    border-left: 1.5px solid #e2e8f0;
    white-space: nowrap;
    font-weight: 600;
}

.za-input-phone {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    flex: 1;
    padding-right: 12px !important;
}

.za-input-phone:focus {
    box-shadow: none !important;
}

/* ─── Radio Group ─── */
.za-radio-group {
    display: flex;
    gap: 10px;
}

.za-radio-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    background: #f8fafc;
}

.za-radio-option:hover {
    border-color: var(--za-primary, #2563eb);
    background: var(--za-primary-light, #eff6ff);
}

.za-radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--za-primary, #2563eb);
    cursor: pointer;
}

.za-radio-option:has(input:checked) {
    border-color: var(--za-primary, #2563eb);
    background: var(--za-primary-light, #eff6ff);
    color: var(--za-primary, #2563eb);
    font-weight: 600;
}

.za-radio-label {
    font-size: 14px;
}

/* ─── Terms Checkbox ─── */
.za-terms-wrap {
    margin: 16px 0;
}

.za-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    line-height: 1.5;
}

.za-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--za-primary, #2563eb);
    cursor: pointer;
}

.za-checkbox-label a {
    color: var(--za-primary, #2563eb);
    text-decoration: none;
}

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

/* ─── Register Button ─── */
.za-btn-register {
    background: linear-gradient(135deg, var(--za-primary, #2563eb), var(--za-primary-dark, #1d4ed8)) !important;
}

/* ─── OTP Context Box ─── */
.za-otp-context {
    text-align: center;
    margin-bottom: 24px;
}

.za-otp-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.za-otp-hint {
    font-size: 15px !important;
    color: #475569 !important;
    margin: 0 0 6px !important;
    line-height: 1.6 !important;
}

.za-otp-expiry {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

/* ─── Progress Steps ─── */
.za-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.za-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.3s;
}

.za-step-dot.active {
    background: var(--za-primary, #2563eb);
    width: 24px;
    border-radius: 4px;
}

.za-step-dot.done {
    background: #22c55e;
}

/* زر تسجيل الخروج [zoon_logout] */
.zoon-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #ef4444;
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
    font-family: inherit;
}
.zoon-logout-btn:hover {
    background: #dc2626;
    color: #fff !important;
}

/* ───────────────────────────────────────── */
/* تنبيه "تحقق من spam" بعد انتهاء العداد   */
/* ───────────────────────────────────────── */
.za-spam-hint {
    display: none;
    direction: rtl;
    flex-direction: row;
    margin: 16px 0 8px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.7;
    color: #713f12;
    text-align: right;
    gap: 12px;
    align-items: flex-start;
    animation: za-spam-fade-in 0.4s ease;
}

.za-spam-hint[style*="block"],
.za-spam-hint[style*="flex"] {
    display: flex !important;
}

.za-spam-hint-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #fbbf24;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.za-spam-hint-icon svg {
    width: 18px;
    height: 18px;
}

.za-spam-hint-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.za-spam-hint-body strong {
    color: #92400e;
    font-size: 14px;
    font-weight: 700;
}
.za-spam-hint-body b {
    color: #92400e;
    font-weight: 700;
}

@keyframes za-spam-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* استجابة الموبايل */
@media (max-width: 480px) {
    .za-spam-hint {
        font-size: 12.5px;
        padding: 12px 14px;
    }
    .za-spam-hint-icon {
        width: 32px;
        height: 32px;
    }
}
