/* ============================================================
   B2B Auth -- Pharmaceutical Blue Theme
   Used by v2/b2b/auth/login | forgot-password | password-reset-link
   ============================================================ */
:root {
  --b2b-bg:        hsl(210 30% 96%);
  --b2b-surface:   hsl(0 0% 100%);
  --b2b-border:    hsl(210 20% 85%);
  --b2b-fg:        hsl(210 40% 18%);
  --b2b-muted:     hsl(210 15% 45%);
  --b2b-accent:    hsl(210 85% 42%);
  --b2b-accent-2:  hsl(210 85% 34%);
  --b2b-accent-soft: hsl(210 80% 94%);
  --b2b-danger:    hsl(0 70% 48%);
  --b2b-ok:        hsl(150 55% 38%);
  --b2b-radius:    0.75rem;
  --b2b-grad:      linear-gradient(140deg, hsl(210 85% 42%) 0%, hsl(210 75% 32%) 55%, hsl(210 70% 22%) 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--b2b-bg);
  color: var(--b2b-fg);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Page shell ---------- */
.auth-page {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  min-height: 100vh;
}

/* ============ LEFT BRAND PANEL -- 3-zone grid (top | mid | bottom) ============ */
.auth-brand {
  background: var(--b2b-grad);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 32px 44px;
  min-height: 100vh;
}
.auth-brand::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 500px at 110% -10%, hsl(210 100% 60% / .35), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, hsl(195 100% 50% / .25), transparent 60%);
}
.auth-brand > * { position: relative; z-index: 1; }

/* TOP -- lockup */
.auth-brand__head { display: flex; align-items: center; gap: 14px; }
.auth-brand__logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  display: grid; place-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.auth-brand__logo img { display: block; width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.auth-brand__company { display: flex; flex-direction: column; line-height: 1.15; }
.auth-brand__company-name { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; display: flex; align-items: center; text-decoration: none; color: inherit; }
.auth-brand__company-logo { display: block; height: 40px; width: auto; }
.auth-brand__company-tag  { font-size: 12px; color: rgba(255,255,255,0.72); font-weight: 500; margin-top: 4px; }
.auth-brand__credit img { vertical-align: middle; }

/* MIDDLE -- hero + cards (centered) */
.auth-brand__inner {
  align-self: center;
  display: flex; flex-direction: column;
  gap: 28px;
  max-width: 520px;
  padding: 24px 0;
}
.auth-brand__headline {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0 0 12px;
}
.auth-brand__sub {
  margin: 0;
  color: rgba(255,255,255,0.82);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 60ch;
}

/* Developer / Brand promo cards (single column) */
.auth-brand__cards { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.auth-brand__card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 18px 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
}
.auth-brand__card-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 8px;
}
.auth-brand__card-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.auth-brand__card-body  { font-size: 13.5px; line-height: 1.55; color: rgba(255,255,255,0.82); margin: 0; }
.auth-brand__card-meta  {
  margin-top: 10px; font-size: 12.5px;
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.auth-brand__card-meta a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 1px;
}
.auth-brand__card-meta a:hover { border-bottom-color: #fff; }
.auth-brand__card-link {
  display: inline-block; margin-top: 8px;
  font-size: 12.5px; color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.5); padding-bottom: 1px;
}
.auth-brand__card-link:hover { border-bottom-color: #fff; }
.auth-brand__dev-logo {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(255,255,255,0.12);
  font-weight: 700; font-size: 12px; letter-spacing: 1.2px;
}
.auth-brand__dev-logo img { display: block; height: 16px; width: auto; }

/* BOTTOM -- legal footer (single row, wraps under 900px) */
.auth-brand__footer {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 18px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.auth-brand__footer .sep { opacity: 0.5; }
.auth-brand__footer a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}
.auth-brand__footer a:hover { border-bottom-color: #fff; color: #fff; }
.auth-brand__credit strong { color: #fff; font-weight: 700; letter-spacing: 0.5px; }

/* ============ RIGHT FORM PANEL ============ */
.auth-form-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
  background: var(--b2b-bg);
  min-height: 100vh;
}
.auth-card {
  background: var(--b2b-surface);
  border: 1px solid var(--b2b-border);
  border-radius: 14px;
  box-shadow: 0 12px 40px -20px hsl(210 50% 30% / 0.25);
  padding: 32px;
  width: 100%;
  max-width: 420px;
}

.auth-card__mobile { display: none; text-align: center; margin-bottom: 20px; }
.auth-card__mobile-name { font-weight: 700; font-size: 18px; color: var(--b2b-fg); }
.auth-card__mobile-tag  { font-size: 12px; color: var(--b2b-muted); }

.auth-card__back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px;
  color: var(--b2b-muted);
  text-decoration: none;
  margin-bottom: 14px;
}
.auth-card__back:hover { color: var(--b2b-accent); }

.auth-card__header { margin-bottom: 22px; }
.auth-card__title { font-size: 22px; font-weight: 700; color: var(--b2b-fg); letter-spacing: -0.2px; }
.auth-card__sub   { font-size: 13.5px; color: var(--b2b-muted); margin-top: 6px; line-height: 1.5; }

/* ---------- Alerts ---------- */
.auth-alert {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px; line-height: 1.4;
  margin-bottom: 14px;
}
.auth-alert svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; }
.auth-alert--error   { background: hsl(0 80% 96%); color: hsl(0 70% 35%); border: 1px solid hsl(0 70% 88%); }
.auth-alert--success { background: hsl(150 60% 95%); color: hsl(150 55% 25%); border: 1px solid hsl(150 50% 82%); }

/* ---------- Form fields ---------- */
.auth-field { margin-bottom: 14px; }
.auth-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--b2b-fg); margin-bottom: 6px; }
.auth-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--b2b-border);
  border-radius: 8px;
  background: #fff;
  color: var(--b2b-fg);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-input:focus { border-color: var(--b2b-accent); box-shadow: 0 0 0 3px hsl(210 85% 42% / .15); }
.auth-input-wrapper { position: relative; }
.auth-toggle-pw {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; padding: 4px;
  color: var(--b2b-muted);
  display: grid; place-items: center;
}
.auth-toggle-pw:hover { color: var(--b2b-accent); }
.auth-toggle-pw svg { width: 18px; height: 18px; }

.auth-row {
  display: flex; justify-content: space-between; align-items: center;
  margin: 6px 0 18px; font-size: 13px;
}
.auth-remember { display: inline-flex; align-items: center; gap: 6px; color: var(--b2b-muted); cursor: pointer; }
.auth-forgot { color: var(--b2b-accent); text-decoration: none; font-weight: 600; }
.auth-forgot:hover { text-decoration: underline; }

.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 14px;
  border-radius: 8px; border: 0;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s;
}
.auth-btn--primary { background: var(--b2b-accent); color: #fff; box-shadow: 0 4px 14px -4px hsl(210 85% 42% / 0.45); }
.auth-btn--primary:hover { background: var(--b2b-accent-2); }
.auth-btn--primary:active { transform: translateY(1px); }
.auth-btn--primary[disabled] { opacity: 0.7; cursor: not-allowed; }

.auth-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: b2b-spin .8s linear infinite;
  display: inline-block;
}
@keyframes b2b-spin { to { transform: rotate(360deg); } }

.auth-bottom { margin-top: 18px; text-align: center; font-size: 13px; color: var(--b2b-muted); }
.auth-bottom a { margin-left: 6px; color: var(--b2b-accent); text-decoration: none; font-weight: 600; }
.auth-bottom a:hover { text-decoration: underline; }

/* reCAPTCHA note + developer mark inside card */
.auth-recaptcha-note { margin-top: 14px; font-size: 11px; color: var(--b2b-muted); line-height: 1.5; text-align: center; }
.auth-recaptcha-note a { color: var(--b2b-accent); text-decoration: none; }
.auth-recaptcha-note a:hover { text-decoration: underline; }
.auth-mark {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed var(--b2b-border);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11px; color: var(--b2b-muted);
}
.auth-mark .dev { font-weight: 700; letter-spacing: 1.2px; color: var(--b2b-fg); text-decoration: none; }
.auth-mark .dev:hover { color: var(--b2b-accent); }

/* ---------- Toast ---------- */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--b2b-surface); border: 1px solid var(--b2b-border);
  border-radius: 8px; padding: 10px 14px;
  box-shadow: 0 8px 24px -8px hsl(210 50% 30% / 0.25);
  font-size: 13px; min-width: 240px;
}
.toast--success { border-left: 3px solid var(--b2b-ok); }
.toast--error   { border-left: 3px solid var(--b2b-danger); }
.toast__title   { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card__mobile { display: block; }
  .auth-form-panel { padding: 28px 16px; min-height: auto; }
  .auth-card { padding: 26px 22px; }
}
