:root {
  --bg: var(--hrx-page-alt, #F6F6F4);
  --surface: var(--hrx-surface, #FFFFFF);
  --ink: var(--hrx-text, #0E0E10);
  --ink-2: var(--hrx-text-2, #2A2A2E);
  --muted: var(--hrx-muted, #6B6B72);
  --muted-2: var(--hrx-muted-2, #9A9AA1);
  --line: var(--hrx-border, #ECECE8);
  --line-2: var(--hrx-border-strong, #E2E2DD);
  --accent: var(--hrx-primary, #312E81);
  --accent-rgb: 49,46,129;
  --accent-soft: var(--hrx-primary-soft, #EEF0FF);
  --accent-mid: #818CF8;
  --success: var(--hrx-success, #16A34A);
  --danger: var(--hrx-danger, #DC2626);
  --danger-soft: var(--hrx-danger-soft, #FEE2E2);
  --shadow: var(--hrx-shadow-card-hover, 0 14px 44px -28px rgba(14,14,16,.30), 0 2px 8px rgba(14,14,16,.05));
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 12%, rgba(var(--accent-rgb),.055), transparent 28%),
    radial-gradient(circle at 82% 88%, rgba(129,140,248,.12), transparent 34%),
    linear-gradient(180deg, #FBFBF9 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01","cv11";
  letter-spacing: -0.005em;
}

button,
input,
select,
textarea { font: inherit; }

button { cursor: pointer; }

svg { display: block; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 456px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(226,226,221,.82);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px;
  backdrop-filter: blur(16px);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 20px;
}

.login-logo img {
  width: 78px;
  height: auto;
}

.login-head { margin-bottom: 20px; }

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.login-badge svg,
.trust-note svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
p { margin: 0; }

.login-head h1 {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.login-head p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.login-form,
.reset-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input::placeholder { color: var(--muted-2); }

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49,46,129,.1);
}

.field input.error {
  border-color: var(--danger);
  background: #FFF9F9;
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 38px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(49,46,129,.08);
}

.password-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .eye-hide {
  display: none;
}

.password-toggle.is-visible .eye-show {
  display: none;
}

.password-toggle.is-visible .eye-hide {
  display: block;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.field-error {
  min-height: 13px;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.3;
}

.primary-btn,
.secondary-btn,
.text-btn {
  border: 0;
  border-radius: 10px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.primary-btn {
  position: relative;
  margin-top: 2px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 14px 24px -18px rgba(49,46,129,.9);
}

.primary-btn:hover,
.primary-btn:focus-visible {
  background: #3730A3;
  transform: translateY(-1px);
  box-shadow: 0 18px 28px -20px rgba(49,46,129,.95);
  outline: none;
}

.primary-btn:disabled {
  cursor: wait;
  opacity: .82;
  transform: none;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
}

.primary-btn.is-loading .btn-spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.secondary-btn {
  min-height: 36px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid rgba(49,46,129,.18);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.secondary-btn:hover,
.secondary-btn:focus-visible {
  background: var(--accent-soft);
  border-color: rgba(49,46,129,.28);
  outline: none;
}

.text-btn {
  align-self: center;
  min-height: 30px;
  padding: 4px 10px;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.text-btn:hover,
.text-btn:focus-visible {
  background: rgba(49,46,129,.07);
  outline: none;
}

.login-message,
.reset-message {
  min-height: 14px;
  color: var(--success);
  font-size: 12px;
  text-align: center;
}

.invite-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 12px;
  padding: 12px 13px;
  background: #FAFAF8;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.invite-block p {
  color: var(--muted);
  font-size: 13px;
}

.trust-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.trust-note svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--accent);
  margin-top: 1px;
}

.reset-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10,10,20,.48);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.reset-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.reset-modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 34px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 32px 90px rgba(0,0,0,.25), 0 4px 14px rgba(0,0,0,.08);
  transform: scale(.96) translateY(16px);
  transition: transform 260ms cubic-bezier(.34,1.26,.64,1);
}

.reset-overlay.is-open .reset-modal {
  transform: scale(1) translateY(0);
}

.reset-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #F2F2EE;
  color: var(--muted);
  touch-action: manipulation;
}

.reset-close:hover,
.reset-close:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.reset-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.reset-step {
  animation: resetStep 220ms ease both;
}

@keyframes resetStep {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.reset-pill {
  display: inline-flex;
  padding: 6px 10px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.reset-step h2 {
  padding-right: 32px;
  margin-bottom: 9px;
  font-size: 23px;
  line-height: 1.18;
  letter-spacing: -.02em;
}

.reset-step p {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.reset-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reset-success {
  text-align: center;
}

.reset-success h2 {
  padding-right: 0;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 4px auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(22,163,74,.1);
  color: var(--success);
}

.success-icon svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: minmax(0, 492px);
    padding: 24px 16px;
  }
}

@media (max-width: 520px) {
  body {
    background: var(--surface);
  }

  .login-shell {
    align-items: stretch;
    min-height: 100vh;
    padding: 0;
  }

  .login-card {
    align-self: stretch;
    min-height: 100vh;
    padding: 24px 18px 28px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--surface);
    backdrop-filter: none;
  }

  .login-head h1 { font-size: 26px; }

  .invite-block {
    align-items: stretch;
    flex-direction: column;
  }

  .secondary-btn,
  .primary-btn { width: 100%; }

  .reset-overlay {
    align-items: stretch;
    padding: 0;
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .reset-modal {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    max-height: none;
    padding: 28px 20px 24px;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }

  .reset-close {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    width: 42px;
    height: 42px;
    z-index: 9200;
  }

  .reset-overlay.is-open .reset-modal {
    transform: none;
  }
}

/* ============================================================================
   HRX unified design-system layer for candidate login and reset flow
   ========================================================================= */
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--hrx-focus-ring, 0 0 0 3px rgba(49,46,129,.12));
}

.login-card,
.invite-block,
.reset-modal {
  border-color: var(--hrx-border, #ECECE8);
  box-shadow: var(--hrx-shadow-card, 0 1px 0 rgba(14,14,16,.04), 0 6px 24px -16px rgba(14,14,16,.14));
}

.login-card {
  border-radius: var(--hrx-marketing-radius, 24px);
}

.login-badge,
.reset-pill {
  background: var(--hrx-primary-soft, #EEF0FF);
  color: var(--hrx-primary, #312E81);
  border-radius: var(--hrx-pill-radius, 999px);
}

.field label {
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--hrx-text-2, #2A2A2E);
}

.field input {
  height: var(--hrx-control-height, 40px);
  border: 1px solid var(--hrx-border-strong, #E2E2DD);
  border-radius: var(--hrx-control-radius, 10px);
  background: var(--hrx-surface, #fff);
}

.field input:focus {
  border-color: var(--hrx-primary, #312E81);
  box-shadow: var(--hrx-focus-ring, 0 0 0 3px rgba(49,46,129,.12));
}

.field input.error {
  border-color: var(--hrx-danger, #DC2626);
  box-shadow: var(--hrx-error-ring, 0 0 0 3px rgba(220,38,38,.10));
}

.primary-btn,
.secondary-btn,
.text-btn,
.reset-close,
.password-toggle {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  letter-spacing: 0;
  transition: background 160ms var(--hrx-motion, ease), border-color 160ms var(--hrx-motion, ease), color 160ms var(--hrx-motion, ease), box-shadow 180ms var(--hrx-motion, ease), transform 160ms var(--hrx-motion, ease);
}

.primary-btn {
  background: var(--hrx-primary, #312E81);
  border: 1px solid var(--hrx-primary, #312E81);
  border-radius: var(--hrx-control-radius, 10px);
}

.primary-btn:hover,
.primary-btn:focus-visible {
  background: var(--hrx-primary-hover, #3730A3);
  border-color: var(--hrx-primary-hover, #3730A3);
}

.secondary-btn {
  background: var(--hrx-surface, #fff);
  border: 1px solid var(--hrx-primary-border, rgba(49,46,129,.18));
  color: var(--hrx-primary, #312E81);
}

.secondary-btn:hover,
.secondary-btn:focus-visible,
.text-btn:hover,
.text-btn:focus-visible,
.password-toggle:hover,
.password-toggle:focus-visible,
.reset-close:hover,
.reset-close:focus-visible {
  background: var(--hrx-primary-soft, #EEF0FF);
  color: var(--hrx-primary, #312E81);
}

.reset-overlay {
  background: var(--hrx-overlay-strong, rgba(10,10,20,.52));
}

.reset-modal {
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: var(--hrx-shadow-modal, 0 32px 90px rgba(14,14,16,.24), 0 4px 16px rgba(14,14,16,.08));
}

.success-icon {
  background: var(--hrx-success-soft, rgba(22,163,74,.1));
  color: var(--hrx-success, #16A34A);
}

@media (max-width: 520px) {
  .login-card,
  .reset-modal {
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  input,
  select,
  textarea,
  .field input {
    font-size: 16px !important;
  }
}
