/* Qamodes authentication shell — shared by /login (agent, real Spring Security form),
   /buyer/login and /supplier/login (both real UI, no functional backend yet — see D-31/
   the Portal Authentication backlog entry). One implementation, three portals, per
   QAMODES_OPERATING_MODEL.md's "one navigation/dashboard framework, not three
   implementations" discipline applied to auth. Consumes qamodes-tokens.css only. */

.q-auth-shell {
  display: flex;
  min-height: 100vh;
  background: var(--surface-0);
}

/* 45/55 split (2026-08-16 login redesign) — login panel left, illustrated hero right. */
.q-auth-panel {
  flex: 0 0 45%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-7) var(--space-8);
  box-sizing: border-box;
}

.q-auth-wordmark {
  margin-bottom: var(--space-8);
  font: var(--text-section-title);
}

.q-auth-form { max-width: 380px; width: 100%; }
.q-auth-form h1 { font: var(--text-hero); font-size: 1.75rem; margin: 0 0 var(--space-2); }
.q-auth-subtitle { color: var(--ink-500); font: var(--text-body); margin: 0 0 var(--space-7); }

/* Comfortable input height on auth screens specifically — taller than the 32px dense
   internal-app control height, a deliberate exception for the first-impression entry
   point (2026-08-16 login redesign). */
.q-auth-form .syc-field input,
.q-auth-form .syc-field select {
  height: 44px;
  font-size: 0.95rem;
}
.q-auth-form .syc-field label {
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.q-auth-field-wrap { position: relative; }
.q-auth-password-toggle {
  position: absolute; right: var(--space-3); top: 38px;
  background: none; border: none; cursor: pointer;
  color: var(--ink-500); display: flex; align-items: center;
  width: 24px; height: 24px; padding: 0;
}
.q-auth-password-toggle:hover { color: var(--ink-900); }
.q-auth-password-toggle .eye-closed { display: none; }
.q-auth-password-toggle.is-showing .eye-open { display: none; }
.q-auth-password-toggle.is-showing .eye-closed { display: block; }

.q-auth-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: var(--space-4) 0 var(--space-5);
  font: var(--text-secondary);
}
.q-auth-remember { display: flex; align-items: center; gap: var(--space-2); }
.q-auth-remember label { margin: 0; font: var(--text-secondary); text-transform: none; letter-spacing: 0; color: var(--ink-700); }
.q-auth-links a { color: var(--brand-primary); text-decoration: none; }
.q-auth-links a:hover { color: var(--brand-primary-hover); text-decoration: underline; }

.q-auth-divider { border: none; border-top: 1px solid var(--line-200); margin: var(--space-6) 0; }
.q-auth-secondary { font: var(--text-secondary); color: var(--ink-500); }

.q-auth-error {
  display: flex; align-items: flex-start; gap: var(--space-2);
  background: var(--danger-bg); color: var(--danger);
  border-radius: var(--radius-control);
  padding: var(--space-3) var(--space-4);
  font: var(--text-secondary);
  margin-bottom: var(--space-5);
}
.q-auth-error:empty { display: none; }
.q-auth-notice {
  background: var(--info-bg); color: var(--info);
  border-radius: var(--radius-control);
  padding: var(--space-3) var(--space-4);
  font: var(--text-secondary);
  margin-bottom: var(--space-5);
}

/* ---- Legacy right-side promo panel (v1 login layout) — kept for any page still
   consuming it (none as of the split-screen redesign below, retained in case a
   lighter-weight auth-adjacent page wants it later). ---- */
.q-auth-promo {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-7);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  background: var(--surface-100);
}
.q-auth-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(27, 107, 69, .10), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(95, 190, 132, .16), transparent 50%),
    radial-gradient(circle at 60% 5%, rgba(46, 139, 87, .08), transparent 40%);
  pointer-events: none;
}
.q-auth-promo-inner { position: relative; max-width: 420px; }
.q-auth-promo-inner h2 { font: var(--text-section-title); color: var(--brand-primary); margin: 0 0 var(--space-2); }
.q-auth-promo-tagline { color: var(--ink-700); font: var(--text-body-medium); margin: 0 0 var(--space-6); }
.q-auth-promo-item { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); align-items: flex-start; }
.q-auth-promo-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: var(--radius-control);
  background: var(--surface-0);
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-primary);
}
.q-auth-promo-text strong { display: block; font: var(--text-body-medium); }
.q-auth-promo-text span { color: var(--ink-500); font: var(--text-secondary); }

.q-auth-portal-switch {
  margin-top: var(--space-6);
  font: var(--text-secondary);
  color: var(--ink-500);
  display: flex; gap: var(--space-4); flex-wrap: wrap;
}
.q-auth-portal-switch a { color: var(--brand-primary); text-decoration: none; }
.q-auth-portal-switch a:hover { text-decoration: underline; }

/* ---- Centered auth card (2026-08-24) — Forgot/Reset password ----
   Deliberately NOT the login screen's 45/55 hero split: these are short, single-purpose
   steps in an already-interrupted flow (the user isn't "arriving" the way a sign-in is),
   so a small centered card reads as faster and calmer. Same tokens/components as every
   other auth screen (.syc-field, .syc-btn-primary, .q-auth-error/.q-auth-notice) — just a
   simpler shell around them. Moderate width on purpose: this is a form, not a landing page. */
.q-auth-card-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  background: var(--surface-0);
  box-sizing: border-box;
}
.q-auth-card {
  width: 100%;
  max-width: 440px;
  margin-top: var(--space-8);
  background: var(--surface-0);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-card);
  padding: var(--space-7) var(--space-7);
  box-sizing: border-box;
}
.q-auth-card .q-auth-wordmark { margin-bottom: var(--space-6); text-align: center; }
.q-auth-card .q-auth-form { max-width: none; }
.q-auth-card .q-auth-secondary { text-align: center; margin-top: var(--space-5); }
@media (max-width: 520px) {
  .q-auth-card { margin-top: var(--space-5); padding: var(--space-6) var(--space-5); }
}

/* ---- Split-screen hero panel (v3, 2026-08-16 login redesign) ----
   Replaces the v2.1 dark-green icon-chip grid with an original editorial-illustration
   scene: a warm, bright sourcing/production floor — a maker at a workbench shaping a
   piece of furniture, a QC inspector checking a finished piece against a clipboard, a
   buyer reviewing a sample, and export crates/a gantry in the distance — communicating
   the Buyer → Sourcing → Supplier → Product → Quality → Production → Logistics → Export
   loop as a scene, not a labeled flowchart. Flat/geometric illustration style (simple
   shapes, no faces/photoreal detail) — hand-built SVG, not a generated or stock image.
   Palette is warm (sand/wood/sky) with Qamodes green as an accent, not the field —
   deliberately not an all-dark-green panel this time. ---- */
.q-auth-hero {
  flex: 0 0 55%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(175deg, #FBF6EC 0%, #F3E9D6 55%, #EADFC6 100%);
  color: var(--surface-0);
  display: flex;
  flex-direction: column;
  padding: var(--space-8) var(--space-7);
  box-sizing: border-box;
}
.q-auth-hero-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.q-auth-hero-wordmark {
  position: relative;
  font: var(--text-section-title);
  font-weight: 700;
  color: var(--brand-green-900);
}
.q-auth-hero-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-width: 480px;
}
.q-auth-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: var(--text-label); text-transform: uppercase; letter-spacing: .08em;
  color: var(--brand-green-700);
  margin-bottom: var(--space-4);
}
.q-auth-hero-eyebrow::before { content: ""; width: 20px; height: 1px; background: var(--brand-green-700); }
.q-auth-hero-heading { font: var(--text-hero); font-size: 1.9rem; line-height: 1.18; margin: 0 0 var(--space-3); color: var(--brand-green-900); }
.q-auth-hero-tagline { font: var(--text-body); color: var(--brand-green-800); opacity: .82; margin: 0; max-width: 420px; }

/* Shown only when .q-auth-hero is hidden (mobile) — see the media query below — so the
   panel never loses its Qamodes branding once the hero's own wordmark disappears. */
.q-auth-panel-wordmark { display: none; }

@media (max-width: 900px) {
  .q-auth-hero { display: none; }
  .q-auth-panel { flex: 1; max-width: none; }
  .q-auth-panel-wordmark { display: block; margin-bottom: var(--space-6); }
}
