/* ──────────────────────────────────────────────────────────────────
   Unified portal auth (corporate + vendor) — NAPSA blue primary.
   Pages now render inside the public layout (navbar + footer), so
   this file styles only the hero strip and the auth card content.
   ────────────────────────────────────────────────────────────────── */

:root {
  --pm-blue: #232d61;
  --pm-blue-deep: #1a2350;
  --pm-blue-soft: #2e3b78;
  --pm-yellow: #f9a61b;
  --pm-bg: #fafbff;
  --pm-card: #ffffff;
  --pm-text: #1c2540;
  --pm-muted: #6b7a99;
  --pm-border: #d0d8ee;
  --pm-error-bg: #fef2f2;
  --pm-error-border: #fecaca;
  --pm-error-text: #991b1b;
  --pm-info-bg: #eef2ff;
  --pm-info-border: #c7d2fe;
  --pm-info-text: #3730a3;
}

/* Hide Vue-controlled elements until the app has mounted, so users
   never see a brief flash of an unstyled state (matches registration). */
[v-cloak] { display: none !important; }

/* ── PAGE HEADER (mirrors registration page hero) ─────────────── */
.auth-page-header {
  background: linear-gradient(115deg, var(--pm-blue) 0%, #1f2b5e 100%);
  padding: 100px 48px 140px;
  position: relative;
  overflow: hidden;
}
.auth-page-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='70' height='70' viewBox='0 0 70 70' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='35' cy='35' r='3' fill='%23f9a61b' fill-opacity='0.07'/%3E%3C/svg%3E");
  pointer-events: none;
}
.auth-page-header-blob {
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,166,27,0.14), transparent 70%);
  top: 50%; right: -100px;
  transform: translateY(-50%);
  pointer-events: none;
}
.auth-page-header-inner {
  position: relative; z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}
.auth-page-header .breadcrumb {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.55);
}
.auth-page-header .breadcrumb a {
  color: rgba(255,255,255,0.55); text-decoration: none;
  transition: color 0.2s;
}
.auth-page-header .breadcrumb a:hover { color: white; }
.auth-page-header .breadcrumb span { color: var(--pm-yellow); font-weight: 700; }
.auth-page-header .breadcrumb svg {
  width: 14px; height: 14px;
  stroke: rgba(255,255,255,0.35); fill: none; stroke-width: 2;
}
.auth-page-header h1 {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 800; color: white;
  letter-spacing: -0.02em; margin-bottom: 12px;
}
.auth-page-header h1 span { color: white; }
.auth-page-header p {
  font-size: 16px; color: rgba(255,255,255,0.75);
  max-width: 560px; line-height: 1.6;
}

/* ── CONTENT SECTION (mirrors .reg-form-section) ──────────────── */
.auth-page-section {
  padding: 56px 24px 96px;
  background: var(--pm-bg);
  position: relative;
}
.auth-page-inner {
  max-width: 560px;
  margin: -120px auto 0;
  position: relative;
  z-index: 2;
}
.auth-page-inner.is-wide { max-width: 640px; }

/* ── AUTH CARD ────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  background: var(--pm-card);
  border: 1px solid #edf2f7;
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 24px 60px -24px rgba(35, 45, 97, 0.30);
}
/* Backwards-compatible variant marker — width now driven by .auth-page-inner. */
.login-card--wide { max-width: none; }

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f3f6fa;
}

.login-brand-mark {
  flex-shrink: 0;
}

.login-brand-mark img {
  height: 40px;
  width: auto;
  display: block;
}

.login-brand-title {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
  color: var(--pm-blue);
}

.login-brand-subtitle {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--pm-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.login-heading {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--pm-blue);
  letter-spacing: -0.01em;
}

.login-lede {
  margin: 0 0 1.75rem;
  color: var(--pm-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.login-alert {
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  line-height: 1.45;
  scroll-margin-top: 88px;
}

.login-alert-error {
  background: var(--pm-error-bg);
  border-color: var(--pm-error-border);
  color: var(--pm-error-text);
}

.login-alert-info {
  background: var(--pm-info-bg);
  border-color: var(--pm-info-border);
  color: var(--pm-info-text);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.login-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pm-text);
  letter-spacing: 0.2px;
}

.login-input {
  border: 1px solid var(--pm-border);
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  font: inherit;
  color: var(--pm-text);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--pm-blue);
  box-shadow: 0 0 0 3px rgba(35, 45, 97, 0.15);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--pm-muted);
  user-select: none;
}

.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--pm-blue);
}

.login-submit {
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--pm-blue), var(--pm-blue-soft));
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
  box-shadow: 0 8px 20px -8px rgba(35, 45, 97, 0.55);
}

.login-submit:hover:not(:disabled) { filter: brightness(1.06); }
.login-submit:active:not(:disabled) { transform: translateY(1px); }
.login-submit:focus-visible {
  outline: 3px solid var(--pm-yellow);
  outline-offset: 2px;
}
.login-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

.login-links {
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  text-align: center;
  color: var(--pm-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.login-links a {
  color: var(--pm-blue);
  font-weight: 700;
  text-decoration: none;
}

.login-links a:hover { text-decoration: underline; }

.login-footnote {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px dashed #e4e9f2;
  font-size: 0.8rem;
  color: var(--pm-muted);
  text-align: center;
  line-height: 1.5;
}

.login-footnote a {
  color: var(--pm-blue);
  font-weight: 700;
  text-decoration: none;
}

.login-footnote a:hover { text-decoration: underline; }

/* ── 6-slot OTP input (create-account page) ────────────────────── */
.reg-otp-slots {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.reg-otp-slot {
  width: 42px;
  height: 50px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  border: 2px solid var(--pm-border);
  border-radius: 10px;
  background: #fff;
  color: var(--pm-text);
  caret-color: var(--pm-blue);
  transition: border-color .15s, box-shadow .15s;
}

.reg-otp-slot:focus {
  outline: none;
  border-color: var(--pm-blue);
  box-shadow: 0 0 0 3px rgba(35, 45, 97, 0.12);
}

.reg-otp-slot:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-submit--secondary {
  margin-top: 0.75rem;
  background: transparent;
  color: var(--pm-blue);
  border: 1px solid rgba(35, 45, 97, 0.28);
  box-shadow: none;
}

.login-submit--secondary:hover {
  background: rgba(35, 45, 97, 0.06);
  filter: none;
}

.login-form--signout {
  margin-top: 0.75rem;
}

/* ── Account-type radio cards (create-account only) ─────────────── */

.account-type-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.account-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

@media (max-width: 480px) {
  .account-type-options {
    grid-template-columns: 1fr;
  }
}

/* Card */
.account-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  padding: 28px 20px 22px;
  border: 2px solid #edf2f7;
  border-radius: 24px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: border-color .25s, box-shadow .25s, transform .25s, background .25s;
}

.account-type-card:hover {
  border-color: rgba(249, 166, 27, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(35, 45, 97, 0.1);
}

.account-type-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Active / selected state */
.account-type-card:has(input[type="radio"]:checked) {
  border-color: var(--pm-yellow);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(249, 166, 27, 0.12), 0 14px 28px rgba(35, 45, 97, 0.1);
}

.account-type-card:has(input[type="radio"]:focus-visible) {
  outline: 3px solid var(--pm-yellow);
  outline-offset: 2px;
}

/* Check badge (top-right corner) */
.account-type-check {
  position: absolute;
  top: 14px; right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--pm-yellow);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity .2s, transform .2s;
}

.account-type-card:has(input[type="radio"]:checked) .account-type-check {
  opacity: 1;
  transform: scale(1);
}

.account-type-check svg {
  width: 12px; height: 12px;
  stroke: white; fill: none; stroke-width: 2.5;
}

/* Icon circle */
.account-type-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pm-blue), var(--pm-blue-soft));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 6px 14px rgba(35, 45, 97, 0.2);
  transition: background .25s;
}

.account-type-card:has(input[type="radio"]:checked) .account-type-icon {
  background: linear-gradient(135deg, var(--pm-yellow), #e8920a);
}

.account-type-icon svg {
  width: 26px; height: 26px;
  stroke: var(--pm-yellow);
  transition: stroke .25s;
}

.account-type-card:has(input[type="radio"]:checked) .account-type-icon svg {
  stroke: #fff;
}

/* Name */
.account-type-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--pm-blue);
  margin-bottom: 8px;
}

/* Description */
.account-type-desc {
  font-size: 12px;
  color: var(--pm-muted);
  line-height: 1.5;
}

/* Badge pill */
.account-type-badge {
  display: inline-block;
  margin-top: 12px;
  background: rgba(249, 166, 27, 0.1);
  border: 1px solid rgba(249, 166, 27, 0.3);
  color: #9a6200;
  font-size: 11px; font-weight: 700;
  padding: 3px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Coming-soon state for account-type cards ─────────────────────── */
.account-type-card--coming-soon {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.account-type-card--coming-soon .account-type-badge {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
  color: #64748b;
}

/* Coming-soon notice banner ─────────────────────────────────────── */
.vendor-coming-soon-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f0f4ff;
  border: 1px solid rgba(35, 45, 97, 0.15);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #232d61;
  line-height: 1.5;
}
.vendor-coming-soon-notice svg {
  flex-shrink: 0;
  width: 18px; height: 18px;
  stroke: var(--pm-yellow, #f9a61b);
  margin-top: 1px;
}

/* Portal sign-out card variant (used by verify-email page) ─────── */
.portal-dashboard-shell { /* legacy — not used now layout has navbar */ }
.portal-dashboard-card { max-width: 520px; }
.portal-dashboard-actions { margin: 0 0 1rem; }

/* ── Password input wrapper (show/hide toggle) ──────────────────── */
.pw-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-input-wrap .login-input {
  flex: 1;
  padding-right: 2.6rem;
}

.pw-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--pm-muted);
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color .15s;
}

.pw-toggle:hover { color: var(--pm-blue); }

.pw-eye {
  width: 18px;
  height: 18px;
  display: block;
}

/* ── Password strength bar ───────────────────────────────────────── */
.pw-strength-bar {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.pw-strength-segment {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--pm-border);
  opacity: 0.15;
  transition: background .3s, opacity .3s;
}

/* ── Password rules checklist ────────────────────────────────────── */
.pw-rules {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pw-rule {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--pm-muted);
  transition: color .2s;
}

.pw-rule-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--pm-border);
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pw-rule--pass {
  color: #15803d;
}

.pw-rule--pass .pw-rule-icon {
  background: #22c55e;
  border-color: #22c55e;
}

.pw-rule--pass .pw-rule-icon::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.pw-rule--fail {
  color: #b91c1c;
}

.pw-rule--fail .pw-rule-icon {
  background: #fee2e2;
  border-color: #ef4444;
}

/* ── Confirm-password match message ──────────────────────────────── */
.pw-match-msg {
  font-size: 0.78rem;
  margin: 5px 0 0;
  min-height: 1.1em;
}

.pw-match-msg--ok  { color: #15803d; }
.pw-match-msg--err { color: #b91c1c; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-page-header { padding: 88px 20px 140px; }
  .auth-page-section { padding: 40px 16px 72px; }
  .auth-page-inner { margin-top: -80px; }
  .login-card { padding: 28px 22px; border-radius: 20px; }
  .login-heading { font-size: 1.4rem; }
  .login-lede { font-size: 0.9rem; }
}

@media (max-width: 480px) {
  .auth-page-header { padding: 80px 16px 140px; }
  .login-brand-mark img { height: 34px; }
}
