﻿/* ── Hawiyati auth extras: dynamic brand colours + utilities ──────────────── */

/* Override the hardcoded teal focus ring with dynamic brand colour */
.input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

/* Arabic font */
[lang="ar"] { font-family: 'Alexandria', system-ui, sans-serif; }

/* ── Language switcher ── */
.lang-switcher {
  position: fixed; top: 16px; right: 16px; z-index: 100;
  display: flex; gap: 2px;
  background: rgba(15,23,42,.95); border-radius: 24px; padding: 4px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 4px 16px rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
}
[dir="rtl"] .lang-switcher { right: auto; left: 16px; }
.lang-btn {
  padding: 5px 12px; border: none; border-radius: 20px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  background: transparent; color: rgba(255,255,255,.4);
  transition: background .15s, color .15s; letter-spacing: .5px;
}
.lang-btn.active, .lang-btn:hover { background: var(--brand-primary); color: #fff; }

/* ── Error box ── */
.error-box {
  border: 1px solid rgba(239,68,68,.3); border-radius: 12px; padding: 12px 14px;
  background: rgba(239,68,68,.1); color: #f87171; font-size: 12px;
  margin-bottom: 16px; line-height: 1.5;
}
.error-actions { margin-top: 8px; }
.error-cancel-link {
  color: #f87171; font-size: 12px; text-decoration: underline; opacity: .85;
}
.error-cancel-link:hover { opacity: 1; }

/* ── Password eye wrapper ── */
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 42px; }
[dir="rtl"] .pwd-wrap .input { padding-right: 12px; padding-left: 42px; }
.eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--muted); display: flex; align-items: center;
}
[dir="rtl"] .eye-btn { right: auto; left: 12px; }
.eye-btn:hover { color: #94a3b8; }

/* ── OTP / monospace code input ── */
.otp-input {
  font-family: 'SF Mono', Menlo, Consolas, monospace !important;
  font-size: 22px !important; letter-spacing: 10px; height: 56px !important;
  text-align: center !important; padding: 0 12px !important;
}

/* ── Step progress dots ── */
.step-dots { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.12); transition: all .2s; }
.step-dot.active { background: var(--brand-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 22%, transparent); }
.step-dot.done { background: var(--brand-accent); }
.step-line { width: 24px; height: 2px; background: rgba(255,255,255,.1); border-radius: 2px; }
.step-line.done { background: color-mix(in srgb, var(--brand-accent) 50%, transparent); }

/* ── Email / OTP hint ── */
.email-hint { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.email-hint .mask { font-family: 'SF Mono', Menlo, Consolas, monospace; color: #e2e8f0; font-weight: 600; }

/* ── Dev hint ── */
.dev-hint {
  border: 1px solid rgba(59,130,246,.22); border-radius: 8px;
  background: rgba(59,130,246,.1); padding: 8px 12px;
  color: #93c5fd; font-size: 11px; margin-top: 8px;
}

/* ── Method picker (SP-driven) ── */
.method-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.method-option {
  width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 9px;
  background: rgba(255,255,255,.03); color: #e2e8f0;
  font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; transition: all .15s;
}
[dir="rtl"] .method-option { text-align: right; }
.method-option:hover { border-color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary), transparent 92%); }

/* ── Success card ── */
.success-card { text-align: center; padding: 4px 0; }
.success-icon-wrap {
  width: 64px; height: 64px; background: rgba(34,197,94,.1);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.success-card h2 { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.success-card p { font-size: 13px; color: var(--muted); line-height: 1.65; margin-bottom: 20px; }
.success-card .button { text-decoration: none; display: flex; align-items: center; justify-content: center; }

/* ── Hint text below input ── */
.hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Resend / back link row ── */
.back-row { text-align: center; margin-top: 10px; }
.back-link { font-size: 12px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: #94a3b8; }

/* ── QR section (TOTP enroll) ── */
.qr-wrap { display: flex; flex-direction: column; align-items: center; margin: 4px 0 16px; }
.qr-img { width: 170px; height: 170px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: #fff; }
.qr-divider { display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0; font-size: 11px; color: var(--muted); }
.qr-divider::before, .qr-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.secret-wrap { display: flex; align-items: center; gap: 8px; background: var(--field-bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; margin-bottom: 16px; }
.secret-key { flex: 1; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; color: #e2e8f0; letter-spacing: 2px; word-break: break-all; }
.btn-copy { padding: 5px 12px; background: transparent; color: var(--brand-primary); border: 1px solid var(--brand-primary); border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.btn-copy:hover { background: var(--brand-primary); color: #fff; }

/* ── Credential table (FIDO2 enroll) ── */
.cred-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 12px; }
.cred-table th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
[dir="rtl"] .cred-table th { text-align: right; }
.cred-table td { padding: 8px; border-bottom: 1px solid rgba(51,65,85,.5); vertical-align: middle; color: #e2e8f0; }
.btn-del { padding: 4px 10px; background: transparent; border: 1px solid rgba(239,68,68,.4); color: #f87171; border-radius: 6px; font-size: 11px; cursor: pointer; transition: background .15s; }
.btn-del:hover { background: rgba(239,68,68,.1); }
.no-creds { font-size: 12px; color: var(--muted); padding: 6px 0 14px; }

/* ── FIDO2 status line ── */
.fido2-status { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }

/* ── form-pane scrollable on short viewports ── */
@media (max-height: 640px) {
  .form-pane { align-items: flex-start; padding-top: 32px; padding-bottom: 32px; }
}

/* ── Signed-as widget (username-first flow: step 2 shows locked username) ── */
.signed-as {
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--brand-primary), transparent 92%); border: 1px solid color-mix(in srgb, var(--brand-primary), transparent 78%);
  border-radius: 9px; padding: 10px 14px; margin-bottom: 16px; gap: 8px;
}
.signed-as-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.signed-as-label { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.signed-as-user  { font-size: 14px; font-weight: 700; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signed-as-change { font-size: 12px; white-space: nowrap; flex-shrink: 0; }
