/* WP 2FA Custom Login – Frontend v3 */

:root {
  --wp2fac-blue:      #2563eb;
  --wp2fac-blue-h:    #1d4ed8;
  --wp2fac-green:     #16a34a;
  --wp2fac-red:       #dc2626;
  --wp2fac-orange:    #d97706;
  --wp2fac-text:      #1e293b;
  --wp2fac-muted:     #64748b;
  --wp2fac-border:    #e2e8f0;
  --wp2fac-bg:        #f8fafc;
  --wp2fac-radius:    10px;
  --wp2fac-shadow:    0 1px 3px rgba(0,0,0,.08);
}

.wp2fac-wrap { width: 100%; font-family: inherit; color: var(--wp2fac-text); }

/* ── Form ────────────────────────────────────────────────── */
.wp2fac-form  { display: flex; flex-direction: column; gap: 18px; }
.wp2fac-field { display: flex; flex-direction: column; gap: 6px; }
.wp2fac-field--row   { flex-direction: row; align-items: center; justify-content: space-between; }
.wp2fac-field--right { align-items: flex-end; }

.wp2fac-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--wp2fac-text);
}

/* ── 2FA field highlight ─────────────────────────────────── */
.wp2fac-field--2fa {
  padding: 14px 16px;
  background: var(--wp2fac-bg);
  border: 1.5px solid var(--wp2fac-blue);
  border-radius: var(--wp2fac-radius);
  gap: 10px;
  animation: wp2fac-in .2s ease;
}
@keyframes wp2fac-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Inputs ──────────────────────────────────────────────── */
.wp2fac-input {
  width: 100%; box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid var(--wp2fac-border);
  border-radius: var(--wp2fac-radius);
  font-size: 1rem;
  color: var(--wp2fac-text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s, opacity .2s;
}
.wp2fac-input:focus {
  border-color: var(--wp2fac-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.wp2fac-input[readonly] { cursor: default; }

.wp2fac-input--code {
  font-size: 1.6rem;
  letter-spacing: .4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.wp2fac-input--backup {
  font-family: monospace;
  font-size: 1.1rem;
  letter-spacing: .1em;
  text-align: center;
}

/* Shake */
.wp2fac--shake { animation: wp2fac-shake .35s ease; }
@keyframes wp2fac-shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-5px); }
  40%,80% { transform: translateX(5px); }
}

/* ── Password wrap ───────────────────────────────────────── */
.wp2fac-pw-wrap { position: relative; display: flex; }
.wp2fac-pw-wrap .wp2fac-input { padding-right: 44px; }
.wp2fac-pw-toggle {
  position: absolute; right: 0; top: 0; bottom: 0; width: 44px;
  background: none; border: none; cursor: pointer;
  color: var(--wp2fac-muted); display: flex; align-items: center; justify-content: center;
}
.wp2fac-pw-toggle:hover { color: var(--wp2fac-text); }

/* ── 2FA Input Wrap ──────────────────────────────────────── */
.wp2fac-2fa-input-wrap { display: flex; flex-direction: column; gap: 8px; }

/* ── Timer ───────────────────────────────────────────────── */
.wp2fac-timer { display: flex; align-items: center; gap: 8px; }
.wp2fac-timer-track {
  flex: 1; height: 4px; background: var(--wp2fac-border);
  border-radius: 99px; overflow: hidden;
}
.wp2fac-timer-fill {
  height: 100%; background: var(--wp2fac-blue);
  border-radius: 99px; transition: width 1s linear, background .3s;
}
.wp2fac-timer-text { font-size: .78rem; color: var(--wp2fac-muted); min-width: 26px; text-align: right; }

/* ── Checkbox ────────────────────────────────────────────── */
.wp2fac-check-label { display: flex; align-items: center; gap: 6px; font-size: .875rem; cursor: pointer; }

/* ── Links ───────────────────────────────────────────────── */
.wp2fac-link    { color: var(--wp2fac-blue); text-decoration: none; font-size: .875rem; }
.wp2fac-link:hover { text-decoration: underline; }
.wp2fac-link--sm { font-size: .8rem; }

.wp2fac-hint { margin: 0; }
.wp2fac-badge {
  display: inline-block; background: var(--wp2fac-bg); border: 1px solid var(--wp2fac-border);
  border-radius: 99px; padding: 1px 8px; font-size: .78rem; color: var(--wp2fac-muted);
}

/* ── Error ───────────────────────────────────────────────── */
.wp2fac-error-msg {
  padding: 10px 14px;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: var(--wp2fac-radius);
  color: var(--wp2fac-red);
  font-size: .875rem;
}

/* ── Button ──────────────────────────────────────────────── */
.wp2fac-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border: none; border-radius: var(--wp2fac-radius);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s, opacity .15s;
}
.wp2fac-btn--primary { background: var(--wp2fac-blue); color: #fff; }
.wp2fac-btn--primary:hover:not(:disabled) { background: var(--wp2fac-blue-h); }
.wp2fac-btn--primary:active { transform: scale(.98); }
.wp2fac-btn--full { width: 100%; }
.wp2fac-btn:disabled { opacity: .65; cursor: not-allowed; }

.wp2fac-btn-spinner {
  display: none; width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: wp2fac-spin .65s linear infinite;
}
.wp2fac-btn.wp2fac--loading .wp2fac-btn-spinner { display: inline-block; }
.wp2fac-btn.wp2fac--loading .wp2fac-btn-text    { opacity: .75; }
@keyframes wp2fac-spin { to { transform: rotate(360deg); } }

/* ── Notices ─────────────────────────────────────────────── */
.wp2fac-notice {
  padding: 12px 16px; border-radius: var(--wp2fac-radius);
  font-size: .9rem; border: 1px solid transparent;
}
.wp2fac-notice--success { background: #f0fdf4; border-color: #bbf7d0; color: var(--wp2fac-green); }
.wp2fac-notice--warning { background: #fffbeb; border-color: #fde68a; color: var(--wp2fac-orange); }
.wp2fac-notice--error   { background: #fef2f2; border-color: #fecaca; color: var(--wp2fac-red); }
