/*
 * Shared password / confirm-password fields and captcha box.
 * Visual source of truth: MediGate register page (auth-unified.css).
 * Default look is the dark auth style; add .pwf--light on a wrapper for white panels.
 * Kept identical in MediGate, MLP and ExerPlan.
 */

.pwf { --pwf-label: rgba(255,255,255,.43); --pwf-bg: rgba(255,255,255,.075); --pwf-bg-focus: rgba(255,255,255,.12);
  --pwf-border: rgba(255,255,255,.14); --pwf-text: #fff; --pwf-placeholder: rgba(255,255,255,.32);
  --pwf-icon: rgba(255,255,255,.36); --pwf-icon-hover: rgba(255,255,255,.78); --pwf-help: rgba(255,255,255,.34);
  --pwf-bar-empty: rgba(255,255,255,.12); --pwf-ok: #6ee7b7; --pwf-bad: #fca5a5;
  --pwf-s1: #f87171; --pwf-s2: #fb923c; --pwf-s3: #facc15; --pwf-s4: #17d7a0;
  --pwf-l1: #f87171; --pwf-l2: #fb923c; --pwf-l3: #facc15; --pwf-l4: #17d7a0;
  display: block; font-family: inherit; }
.pwf, .pwf *, .pwf *::before, .pwf *::after { box-sizing: border-box; }

.pwf--light, .pwf--light .pwf { --pwf-label: #64748b; --pwf-bg: #f8fafc; --pwf-bg-focus: #fff;
  --pwf-border: #e2e8f0; --pwf-text: #0f172a; --pwf-placeholder: #94a3b8;
  --pwf-icon: #94a3b8; --pwf-icon-hover: #475569; --pwf-help: #64748b;
  --pwf-bar-empty: rgba(15,23,42,.1); --pwf-ok: #059669; --pwf-bad: #dc2626;
  --pwf-l1: #dc2626; --pwf-l2: #ea580c; --pwf-l3: #ca8a04; --pwf-l4: #059669; }

.pwf .pwf-label {
  display: block; margin: 0 0 .25rem; padding-right: .15rem;
  color: var(--pwf-label); font-size: .72rem; font-weight: 600; line-height: 1.5;
}

.pwf .pwf-wrap { position: relative; }

.pwf .pwf-input {
  display: block; width: 100%; min-height: 3.25rem; margin: 0;
  border: 1px solid var(--pwf-border) !important; border-radius: .95rem !important;
  background: var(--pwf-bg) !important; color: var(--pwf-text) !important;
  padding: .85rem 1rem !important; font-size: .9rem !important; font-family: inherit !important;
  line-height: 1.5; box-shadow: none !important; outline: none !important; appearance: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.pwf .pwf-wrap .pwf-input { padding-left: 3rem !important; }
.pwf .pwf-input::placeholder { color: var(--pwf-placeholder); opacity: 1; }
.pwf .pwf-input:focus {
  background: var(--pwf-bg-focus) !important; border-color: rgba(23,215,160,.55) !important;
  box-shadow: 0 0 0 3px rgba(23,215,160,.12) !important;
}
.pwf .pwf-input.is-match { border-color: rgba(23,215,160,.5) !important; }
.pwf .pwf-input.is-mismatch { border-color: rgba(248,113,113,.55) !important; }

.pwf .pwf-toggle {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  width: 2rem; height: 2rem; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--pwf-icon); border: 0; background: transparent; cursor: pointer; box-shadow: none;
}
.pwf .pwf-toggle:hover { color: var(--pwf-icon-hover); background: transparent; }
.pwf .pwf-toggle svg { width: 1.15rem; height: 1.15rem; display: block; }
.pwf .pwf-toggle .pwf-eye-open { display: none; }
.pwf .pwf-toggle[aria-pressed="true"] .pwf-eye-open { display: block; }
.pwf .pwf-toggle[aria-pressed="true"] .pwf-eye-closed { display: none; }

.pwf .pwf-strength { display: none; margin-top: .5rem; }
.pwf .pwf-strength.show { display: block; }
.pwf .pwf-strength-bars { display: flex; gap: .35rem; margin-bottom: .3rem; }
.pwf .pwf-strength-bars span { height: .25rem; flex: 1; border-radius: 99px; background: var(--pwf-bar-empty); }
.pwf .pwf-strength-label { margin: 0; font-size: .75rem; line-height: 1rem; }
.pwf .pwf-strength[data-score="1"] span:nth-child(-n+1) { background: var(--pwf-s1); }
.pwf .pwf-strength[data-score="2"] span:nth-child(-n+2) { background: var(--pwf-s2); }
.pwf .pwf-strength[data-score="3"] span:nth-child(-n+3) { background: var(--pwf-s3); }
.pwf .pwf-strength[data-score="4"] span:nth-child(-n+4) { background: var(--pwf-s4); }
.pwf .pwf-strength[data-score="0"] .pwf-strength-label,
.pwf .pwf-strength[data-score="1"] .pwf-strength-label { color: var(--pwf-l1); }
.pwf .pwf-strength[data-score="2"] .pwf-strength-label { color: var(--pwf-l2); }
.pwf .pwf-strength[data-score="3"] .pwf-strength-label { color: var(--pwf-l3); }
.pwf .pwf-strength[data-score="4"] .pwf-strength-label { color: var(--pwf-l4); }

.pwf .pwf-help { margin: .25rem 0 0; color: var(--pwf-help); font-size: .72rem; line-height: 1.75; }
.pwf .pwf-error,
.pwf .pwf-match { margin: .28rem 0 0; color: var(--pwf-bad); font-size: .76rem; line-height: 1.7; }
.pwf .pwf-match:empty { display: none; }
.pwf .pwf-match.is-match { color: var(--pwf-ok); }
.pwf .pwf-match.is-mismatch { color: var(--pwf-bad); }

/* Captcha: image + refresh button inside one glass box, then the code input. */
.pwf .pwf-captcha { display: flex; flex-direction: column; gap: .75rem; }
.pwf .pwf-captcha-box {
  display: flex; align-items: center; gap: .5rem; padding: .25rem;
  border-radius: .85rem; background: var(--pwf-bg); border: 1px solid var(--pwf-border);
}
.pwf .pwf-captcha-image {
  flex: 1; min-width: 0; display: flex; align-items: center;
  padding: .5rem; border-radius: .5rem; border: 1px solid #d1d5db; background: #f3f4f6;
}
.pwf .pwf-captcha-image img {
  display: block; width: 100%; height: 3.25rem; object-fit: cover; border-radius: .65rem;
  user-select: none; -webkit-user-select: none;
}
.pwf .pwf-captcha-refresh {
  flex: 0 0 auto; min-width: 3.35rem; min-height: 3.35rem; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; cursor: pointer;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.72); border-radius: .9rem; transition: all .18s ease;
}
.pwf .pwf-captcha-refresh:hover { background: rgba(255,255,255,.1); color: #fff; }
.pwf .pwf-captcha-refresh:disabled { opacity: .55; cursor: not-allowed; }
.pwf .pwf-captcha-refresh svg { width: 1.1rem; height: 1.1rem; display: block; }
.pwf .pwf-captcha-status { margin: 0; color: var(--pwf-bad); font-size: .76rem; line-height: 1.7; }
.pwf .pwf-captcha-status[hidden] { display: none; }
.pwf .pwf-captcha .pwf-input { direction: rtl; }
