/* ════════════════════════════════════════════════════════════════
   MI TURNO · modals/misc.css
   ════════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  top: max(14px, calc(var(--sat) + 6px));
  left: 50%;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  color: var(--text);
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  z-index: 400;
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 20%, transparent),
    0 12px 36px rgba(20, 30, 60, 0.1),
    0 2px 8px rgba(20, 30, 60, 0.04);
  white-space: nowrap;
  animation: fadeUp 0.35s var(--spring);
}

.empty {
  text-align: center;
  padding: 42px 20px;
  color: var(--muted);
}

.empty-ico {
  font-size: 38px;
  margin-bottom: 12px;
  opacity: 0.32;
  display: inline-block;
  color: var(--accent);
}

.empty-txt {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.empty-sub {
  font-size: 12px;
  margin-top: 5px;
  opacity: 0.7;
  font-weight: 500;
}

.rec-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 11px;
  flex-shrink: 0;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: var(--surface2);
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s var(--spring);
}

.theme-swatch:active {
  transform: scale(0.96);
}

.theme-swatch.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.swatch-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.swatch-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.theme-swatch.active .swatch-name {
  color: var(--accent);
}

.pin-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}

.pin-cell {
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
}

.pin-cell:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.vf-step {
  text-align: center;
  padding: 4px 0;
}

.vf-icon {
  font-size: 38px;
  margin-bottom: 10px;
  opacity: 0.85;
  display: block;
}

.vf-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.vf-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.vf-progress-wrap {
  margin-bottom: 20px;
}

.vf-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.vf-progress-lbls {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-top: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.vf-progress-lbl {
  min-width: 76px;
  max-width: 92px;
  text-align: center;
  opacity: 0.38;
  transition:
    opacity 0.25s var(--ease),
    color 0.25s var(--ease);
}

.vf-progress-lbl.on {
  opacity: 1;
  color: var(--accent);
}

.vf-progress-lbl.done {
  opacity: 0.72;
  color: var(--success);
}

.vf-pip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid var(--border);
  color: var(--muted);
  background: var(--surface2);
  transition: all 0.3s var(--spring);
}

.vf-pip.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.vf-pip.done {
  border-color: var(--success);
  color: #fff;
  background: var(--success);
}

.vf-line {
  width: 28px;
  height: 2px;
  background: var(--border);
  transition: background 0.3s var(--ease);
}

.vf-line.done {
  background: var(--success);
}

.vf-phone-hint {
  font-size: 10.5px;
  color: var(--success);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 6px 0 10px;
  letter-spacing: 0.02em;
}

.vf-countdown {
  font-size: 28px;
  font-weight: 200;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
  margin: 8px 0;
  text-align: center;
}

.vf-countdown.expired {
  color: var(--danger);
}

.vf-fallback-code {
  background: var(--accent-dim);
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.vf-fallback-warn {
  font-size: 10px;
  color: var(--danger);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
  text-align: center;
}

.code-grid {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 12px 0;
}

.code-cell {
  width: 40px;
  height: 48px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
}

.code-cell:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.pin-setup-wrap {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 22px max(28px, var(--sab));
  background: var(--bg);
  animation: fadeIn 0.3s var(--ease);
}

.pin-setup-card {
  width: 100%;
  max-width: 360px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-radius: var(--radius);
  padding: 28px 22px;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  box-shadow:
    0 1px 0 color-mix(in srgb, white 20%, transparent) inset,
    0 20px 60px rgba(0, 0, 0, 0.1);
}

.pin-setup-step {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.pin-setup-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.pin-setup-step-num.done {
  background: var(--success);
}

.pin-setup-step-num.pending {
  background: var(--border2);
  color: var(--muted);
}

.pin-setup-step-line {
  width: 20px;
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}

.pin-setup-step-line.done {
  background: var(--success);
}

.diag-sec {
  margin-bottom: 16px;
}

.diag-sec-ttl {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.diag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 12.5px;
  border: 1px solid var(--border);
}

.diag-row-k {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.diag-row-v {
  color: var(--muted);
  font-size: 11.5px;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diag-pin-big {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.diag-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.diag-badge.ok {
  background: var(--success-dim);
  color: var(--success);
}

.diag-badge.warn {
  background: var(--danger-dim);
  color: var(--danger);
}

.diag-badge.cloud {
  background: var(--accent-dim);
  color: var(--accent);
}

.diag-badge.local {
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  color: var(--muted);
}

.diag-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.diag-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 4px;
}

/* ─── OTP local (offline): preparación + revelado ──────────── */
.otp-prep {
  text-align: center;
  padding: 12px 0 6px;
}
.otp-prep-shield {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 30px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.otp-prep-shield-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  filter: blur(14px);
  z-index: -1;
  animation: otpPrepPulse 2.2s ease-in-out infinite;
}
.otp-prep-shield-icon {
  font-size: 36px;
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
  animation: otpPrepSpin 6s linear infinite;
}
@keyframes otpPrepPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.12); }
}
@keyframes otpPrepSpin {
  to { transform: rotate(360deg); }
}
.otp-prep-bar-wrap {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.otp-prep-bar {
  width: 220px;
  height: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.otp-prep-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2, var(--accent)));
  border-radius: 999px;
  transition: width 1s linear;
  box-shadow: 0 0 12px var(--accent-glow);
}
.otp-prep-sec {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* Código revelado en pantalla, estilo "Apple verification code" */
.otp-reveal {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 16px auto 4px;
  padding: 14px 18px;
  background: var(--glass-mid);
  -webkit-backdrop-filter: var(--blur-md);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 320px;
  box-shadow:
    0 8px 22px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: otpRevealIn 0.45s var(--spring);
}
.otp-reveal-digit {
  font-family: 'SF Mono', 'Menlo', ui-monospace, monospace;
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  min-width: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
@keyframes otpRevealIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
[data-theme='dark'] .otp-reveal {
  background: rgba(20, 24, 40, 0.55);
}
