/* ==========================================================================
   HFM Auth — Design tokens
   ========================================================================== */
:root {
  --navy-900: #0E1E36;
  --navy-800: #142743;
  --navy-700: #1B3357;
  --bronze: #B08D57;
  --bronze-light: #D3B583;

  --bg-page: #F4F5F7;
  --bg-card: #FFFFFF;
  --border: #E1E4E9;
  --border-strong: #C7CCD4;

  --text-primary: #101828;
  --text-secondary: #5B6472;
  --text-inverse: #F4F5F7;
  --text-inverse-muted: #A9B4C4;

  --danger: #B3261E;
  --danger-bg: #FBEAE9;
  --danger-border: #F1C3C0;

  --focus-ring: #B08D57;

  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -8px rgba(16, 24, 40, 0.10);
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
input { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Shell layout
   ========================================================================== */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 38%) 1fr;
}

/* ---- Brand panel (left) ---- */
.brand-panel {
  position: relative;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--navy-700) 0%, var(--navy-900) 60%);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  overflow: hidden;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--bronze) 45%, transparent);
  opacity: 0.6;
}

.brand-panel::after {
  content: "";
  position: absolute;
  right: -160px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(176, 141, 87, 0.18);
}

.brand-panel__inner {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.brand-mark { margin-bottom: 28px; }

.brand-name {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}
.brand-name span {
  color: var(--bronze-light);
  font-weight: 400;
}

.brand-tagline {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-inverse-muted);
  margin-bottom: 40px;
}

.status-readout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--text-inverse-muted);
}
.status-readout li { display: flex; align-items: center; gap: 10px; }
.status-readout .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bronze-light);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.15);
  flex: none;
}

.brand-panel__footer {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: rgba(169, 180, 196, 0.6);
  display: flex;
  gap: 8px;
}
.brand-panel__footer .sep { opacity: 0.5; }

/* ---- Form panel (right) ---- */
.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.form-card {
  width: 100%;
  max-width: 380px;
}

.form-card__header { margin-bottom: 28px; }
.form-card__header h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}
.form-card__header p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- SSO notice banner ---- */
.sso-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 20px;
}

/* ---- SSO buttons ---- */
.sso-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.sso-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sso-button:hover { background: #FAFAFB; border-color: #AEB4BE; }
.sso-button:active { background: #F1F2F4; }

/* ---- Divider ---- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Form fields ---- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: #9AA2AE; }
.field input:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(27, 51, 87, 0.10);
}
.field input:invalid:not(:placeholder-shown) {
  border-color: var(--danger-border);
}

.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.toggle-visibility {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.toggle-visibility:hover { background: #F1F2F4; color: var(--text-primary); }

/* ---- Row: remember + forgot ---- */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.checkbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--navy-700);
}

.link-muted {
  font-size: 13px;
  color: var(--navy-700);
  text-decoration: none;
}
.link-muted:hover { text-decoration: underline; }

/* ---- Inline form error ---- */
.form-error {
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
}

/* ---- Primary button ---- */
.primary-button {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-inverse);
  background: var(--navy-900);
  border: 1px solid var(--navy-900);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.primary-button:hover { background: var(--navy-700); border-color: var(--navy-700); }
.primary-button:active { background: var(--navy-800); }
.primary-button:disabled {
  background: #8B95A3;
  border-color: #8B95A3;
  cursor: not-allowed;
}

/* ---- Footer ---- */
.form-card__footer {
  margin-top: 28px;
  text-align: center;
}
.form-card__footer p {
  font-size: 12px;
  color: #9AA2AE;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }

  .brand-panel {
    padding: 32px 28px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .brand-panel::after { display: none; }
  .brand-panel__inner { max-width: none; display: flex; align-items: center; gap: 16px; }
  .brand-mark { margin-bottom: 0; }
  .brand-tagline, .status-readout { display: none; }
  .brand-name { margin-bottom: 0; font-size: 18px; }
  .brand-panel__footer { display: none; }

  .form-panel { padding: 40px 20px 56px; }
}

@media (max-width: 380px) {
  .sso-button span { font-size: 13px; }
}
