/* Hallmark · macrostructure: Split-Diptych · tone: industrial-utilitarian · anchor hue: amber (~75°)
 * genre: utilitarian · design-system: design.md · designed-as-app
 * Auth surface for Quest HQ. Tokens come from tokens.css (loaded first).
 * IBM Plex (Sans/Condensed/Mono) · squared corners · flat surfaces · no glow/kickers.
 * contrast: pass (46–50) · focus rings + reduced-motion inherited from tokens.css
 */

.login-body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

/* ---------- LEFT · editorial panel ---------- */
.login-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2xl);
  padding: clamp(32px, 5vw, 64px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  min-width: 0;
}
/* amber registration mark — a tool detail, not a glow */
.login-aside::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 56px;
  background: var(--amber);
}

.login-aside-top { display: flex; align-items: center; gap: var(--space-sm); }

.login-aside-mid { max-width: 460px; }
.login-statement {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0 0 var(--space-sm);
  color: var(--ink);
  overflow-wrap: break-word;
  min-width: 0;
}
.login-lede {
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
  max-width: 44ch;
}

/* mono spec sheet — replaces the marketing feature list */
.login-spec {
  margin: 0;
  display: grid;
  gap: 0;
  font-family: var(--font-mono);
}
.login-spec > div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--space-md);
  padding: var(--space-xs) 0;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
}
.login-spec dt {
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--text-xs);
}
.login-spec dd { margin: 0; color: var(--ink-2); }

.login-aside-foot {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
}

/* ---------- RIGHT · auth column ---------- */
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px) 20px;
  min-width: 0;
}
.login-shell {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* compact brand shown only when the diptych collapses (mobile) */
.login-brand { display: none; align-items: center; gap: var(--space-sm); }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-lg);
  box-shadow: var(--shadow-lg);
}

.login-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--ink);
}
.login-sub {
  font-size: var(--text-base);
  color: var(--ink-2);
  margin: 0 0 var(--space-lg);
}

/* ---------- tabs ---------- */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}
.auth-subtabs {
  margin-bottom: var(--space-sm);
  background: transparent;
  padding: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  gap: 0;
}
.auth-subtabs .auth-tab {
  border-radius: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  box-shadow: none;
  font-size: 11.5px;
  padding: 6px 8px;
}
.auth-subtabs .auth-tab.active {
  background: transparent;
  border-bottom-color: var(--amber);
  box-shadow: none;
  color: var(--ink);
}
.auth-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-3);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.auth-tab i { font-size: 14px; }
.auth-tab:hover { color: var(--ink-2); }
.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ---------- form panels ---------- */
.auth-panel { display: flex; flex-direction: column; gap: 6px; }
.auth-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-xs);
}
.auth-panel input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: var(--text-base);
}
.auth-panel .btn-primary-wide { margin-top: var(--space-md); margin-bottom: 6px; }
.auth-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  margin: 6px 0 0;
  text-align: center;
}

/* Inline text-button link, e.g. "Forgot password?" / "Back to sign in". */
.auth-linkbtn {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 4px;
  background: none;
  border: 0;
  color: var(--ink-3);
  font-size: var(--text-sm);
  text-align: center;
  cursor: pointer;
  min-height: 32px;
}
.auth-linkbtn:hover { color: var(--ink); text-decoration: underline; }

.auth-error,
.auth-info {
  margin-top: var(--space-sm);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.auth-error {
  background: var(--rust-bg);
  color: var(--rust-ink);
  border: 1px solid var(--rust);
}
.auth-info {
  background: var(--green-bg);
  color: var(--green-ink);
  border: 1px solid var(--green);
}

.login-foot {
  margin-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--ink-3);
  text-align: center;
}

/* ---------- signed-in / pending cards ---------- */
.signed-in-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}
.signed-in-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--color-accent-ink);
  font-size: var(--text-md);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.signed-in-avatar img { width: 100%; height: 100%; object-fit: cover; }
.signed-in-meta { display: flex; flex-direction: column; min-width: 0; }
.signed-in-name { font-size: var(--text-md); font-weight: 600; color: var(--ink); }
.signed-in-email { font-size: var(--text-sm); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- wide buttons ---------- */
.btn-primary-wide {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--amber);
  color: var(--color-accent-ink);
  font-weight: 600;
  font-size: var(--text-base);
  margin-bottom: 10px;
  transition: filter var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn-primary-wide:hover { filter: brightness(1.07); }
.btn-primary-wide:active { transform: translateY(1px); }
.btn-primary-wide i { font-size: 16px; }

.btn-ghost-wide {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-2);
  font-weight: 500;
  font-size: var(--text-base);
  border: 1px solid var(--border);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn-ghost-wide:hover { background: var(--bg-2); color: var(--ink); }
.btn-ghost-wide i { font-size: 16px; }

/* ---------- pending banner ---------- */
.pending-banner {
  display: flex;
  gap: var(--space-sm);
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  margin-bottom: var(--space-md);
}
.pending-banner i {
  color: var(--amber-ink);
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.pending-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--amber-ink);
  margin-bottom: 3px;
}
.pending-sub {
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink-2);
}

.hidden { display: none !important; }

/* ---------- responsive: collapse the diptych ---------- */
@media (max-width: 860px) {
  .login-split { grid-template-columns: minmax(0, 1fr); }
  .login-aside {
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: var(--space-lg);
    padding: clamp(28px, 7vw, 44px) 22px;
  }
  .login-spec,
  .login-aside-foot { display: none; }
  .login-lede { font-size: var(--text-base); }
}

@media (max-width: 520px) {
  .login-aside-mid { max-width: none; }
  .login-card { padding: var(--space-md); }
}

/* ---------- mobile polish: touch targets + iOS zoom avoidance ---------- */
@media (max-width: 720px) {
  /* iOS Safari zooms inputs with font-size < 16px on focus. */
  .auth-panel input { font-size: 16px; height: 48px; padding: 0 14px; }
  .auth-tab { padding: 12px 10px; min-height: 44px; font-size: var(--text-sm); }
  .btn-primary-wide,
  .login-card button[type="submit"],
  .login-card .btn { min-height: 48px; font-size: 15px; }
  /* Honor iPhone safe area */
  .login-body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    /* Use dynamic vh so the keyboard doesn't push content off-screen */
    min-height: 100dvh;
  }
  .login-split { min-height: 100dvh; }

  /* Hide the editorial brand panel on phones — the "Operations board"
     headline + lede push the actual sign-in form below the fold, and
     sign-in is the only thing a user comes here to do. The compact
     .login-brand (already in the form column, just `display: none` by
     default) takes over as the identity. */
  .login-aside { display: none; }
  .login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
  }

  /* Center the auth column with phone-appropriate breathing room and
     let the card span the column instead of capping at 380px. */
  .login-main { padding: 32px 16px; }
  .login-shell { gap: 12px; max-width: 100%; }
  .login-card {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
  }
  .login-title { font-size: var(--text-xl); }
  .login-sub   { margin-bottom: var(--space-md); }
}

@media (hover: none) and (pointer: coarse) {
  .auth-tab:hover { color: var(--ink-3); }
  .auth-tab.active:hover { color: var(--ink); }
  .auth-tab,
  .login-card button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
}
