/* ═══════════════════════════════════════════════════════════════
   Qadiyah Auth — Modal Styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── Modal wrapper ─────────────────────────────────────────── */
.qauth-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.qauth-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ─── Box ───────────────────────────────────────────────────── */
.qauth-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card, #12121a);
    border: 1px solid var(--border-color, #2a2a3a);
    border-radius: 18px;
    padding: 28px 26px 24px;
    direction: rtl;
    animation: qauthIn .22s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #2a2a3a) transparent;
}

@keyframes qauthIn {
    from { opacity: 0; transform: translateY(-16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)     scale(1);   }
}

/* prevent body scroll when modal is open */
body.qauth-open { overflow: hidden; }

/* ─── Close button ──────────────────────────────────────────── */
.qauth-close {
    position: absolute;
    top: 14px;
    left: 14px;   /* RTL: top-left */
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: color .2s, background .2s;
}
.qauth-close:hover {
    color: var(--text-primary, #fff);
    background: var(--bg-hover, #1e1e2e);
}

/* ─── Brand ─────────────────────────────────────────────────── */
.qauth-brand {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color, #6c5ce7);
    margin-bottom: 18px;
    letter-spacing: .5px;
}
.qauth-brand-icon { margin-left: 6px; }

/* ─── Tabs ──────────────────────────────────────────────────── */
.qauth-tabs {
    display: flex;
    background: var(--bg-secondary, #1a1a28);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
    margin-bottom: 20px;
}

.qauth-tab {
    flex: 1;
    padding: 8px 10px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary, #888);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}
.qauth-tab.active {
    background: var(--primary-color, #6c5ce7);
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 92, 231, .35);
}

/* ─── Message ───────────────────────────────────────────────── */
.qauth-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin-bottom: 14px;
    line-height: 1.5;
}
.qauth-message.success {
    background: rgba(46, 204, 113, .12);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, .25);
}
.qauth-message.error {
    background: rgba(231, 76, 60, .12);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, .25);
}

/* ─── Google button ─────────────────────────────────────────── */
.qauth-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    background: #ffffff;
    color: #333;
    border: 1.5px solid #ddd;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s, box-shadow .2s, border-color .2s;
}
.qauth-google-btn:hover {
    background: #f7f7f7;
    border-color: #bbb;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.qauth-google-btn:active { transform: translateY(1px); }

/* ─── Divider ───────────────────────────────────────────────── */
.qauth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: var(--text-secondary, #555);
    font-size: 12px;
}
.qauth-divider::before,
.qauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, #2a2a3a);
}

/* ─── Form fields ───────────────────────────────────────────── */
.qauth-field { margin-bottom: 14px; }

.qauth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
    margin-bottom: 6px;
}

.qauth-field input[type="text"],
.qauth-field input[type="email"],
.qauth-field input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input, #1a1a28);
    border: 1.5px solid var(--border-color, #2a2a3a);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    direction: ltr;
    transition: border-color .2s, box-shadow .2s;
}
.qauth-field input:focus {
    outline: none;
    border-color: var(--primary-color, #6c5ce7);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, .15);
}
.qauth-field input.qauth-invalid { border-color: #e74c3c; }

.qauth-hint {
    display: block;
    font-size: 11px;
    color: var(--text-secondary, #666);
    margin-top: 4px;
}

/* ─── Password field with eye toggle ────────────────────────── */
.qauth-field-pass { position: relative; }
.qauth-field-pass input { padding-left: 40px; }
.qauth-eye {
    position: absolute;
    bottom: 10px;
    left: 12px;
    background: none;
    border: none;
    color: var(--text-secondary, #666);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    transition: color .2s;
}
.qauth-eye:hover { color: var(--text-primary, #fff); }

/* ─── Password strength bar ─────────────────────────────────── */
.qauth-pass-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    background: var(--border-color, #2a2a3a);
    transition: width .3s, background .3s;
    width: 0;
}
.qauth-pass-strength.weak   { width: 33%; background: #e74c3c; }
.qauth-pass-strength.medium { width: 66%; background: #f39c12; }
.qauth-pass-strength.strong { width: 100%; background: #2ecc71; }

/* ─── Submit button ─────────────────────────────────────────── */
.qauth-submit {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 9px;
    margin-top: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .1s;
}
.qauth-submit:disabled { opacity: .7; cursor: not-allowed; }
.qauth-submit:active:not(:disabled) { transform: translateY(1px); }

/* ─── Verify panel ──────────────────────────────────────────── */
.qauth-verify-icon {
    text-align: center;
    font-size: 52px;
    color: var(--primary-color, #6c5ce7);
    margin-bottom: 10px;
}
.qauth-verify-title {
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 8px;
}
.qauth-verify-desc {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary, #aaa);
    line-height: 1.7;
    margin: 0 0 22px;
}

/* ─── OTP inputs ────────────────────────────────────────────── */
.qauth-otp-wrap {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.qauth-otp {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    font-family: monospace;
    background: var(--bg-input, #1a1a28);
    border: 2px solid var(--border-color, #2a2a3a);
    border-radius: 10px;
    color: var(--text-primary, #fff);
    transition: border-color .2s, box-shadow .2s;
    padding: 0;
}
.qauth-otp:focus {
    outline: none;
    border-color: var(--primary-color, #6c5ce7);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, .15);
}
.qauth-otp.filled {
    border-color: var(--primary-color, #6c5ce7);
    background: rgba(108, 92, 231, .08);
}
.qauth-otp.error {
    border-color: #e74c3c;
    animation: qauthShake .3s ease;
}

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

/* ─── Resend ────────────────────────────────────────────────── */
.qauth-resend {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary, #888);
    margin-top: 16px;
}
.qauth-resend-btn {
    background: none;
    border: none;
    color: var(--primary-color, #6c5ce7);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    margin-right: 4px;
    padding: 0;
    transition: opacity .2s;
}
.qauth-resend-btn:disabled {
    color: var(--text-secondary, #888);
    cursor: not-allowed;
}

/* ─── Light theme overrides ─────────────────────────────────── */
body.light-theme .qauth-box,
body[data-theme="light"] .qauth-box {
    background: #ffffff;
    border-color: #e0e0ee;
}

body.light-theme .qauth-tabs,
body[data-theme="light"] .qauth-tabs { background: #f0f0f7; }

body.light-theme .qauth-field input[type="text"],
body.light-theme .qauth-field input[type="email"],
body.light-theme .qauth-field input[type="password"],
body[data-theme="light"] .qauth-field input[type="text"],
body[data-theme="light"] .qauth-field input[type="email"],
body[data-theme="light"] .qauth-field input[type="password"] {
    background: #f5f5fb;
    border-color: #d0d0e0;
    color: #111;
}

body.light-theme .qauth-otp,
body[data-theme="light"] .qauth-otp {
    background: #f5f5fb;
    border-color: #d0d0e0;
    color: #111;
}

body.light-theme .qauth-close,
body[data-theme="light"] .qauth-close { color: #555; }
body.light-theme .qauth-close:hover,
body[data-theme="light"] .qauth-close:hover {
    color: #111;
    background: #f0f0f7;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .qauth-box { padding: 22px 16px 20px; border-radius: 14px; }
    .qauth-otp { width: 40px; height: 48px; font-size: 18px; }
    .qauth-otp-wrap { gap: 6px; }
}
@media (max-width: 360px) {
    .qauth-otp { width: 34px; height: 42px; font-size: 16px; }
}
