/* HRSphere sign-in pages. Brand colours come from the company (--brand, --action, --on-action on <body>). */
:root {
  --ink: #0B0F14;
  --text: #202939;
  --muted: #4B5565;
  --subtle: #697586;
  --border: #E3E8EF;
  --surface: #FFFFFF;
  --bg: #F8FAFC;
  --danger: #B42318;
  --danger-bg: #FEF3F2;
  --info: #175CD3;
  --info-bg: #EFF8FF;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.04), 0 12px 32px -8px rgb(16 24 40 / 0.12);
  --font-heading: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.auth {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
}

/* ---- Brand panel -------------------------------------------------------------------------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: #fff;
  background:
    radial-gradient(1200px 600px at -10% -10%, color-mix(in srgb, var(--brand) 85%, #fff 15%) 0%, transparent 60%),
    radial-gradient(900px 700px at 110% 110%, color-mix(in srgb, var(--action) 80%, #000 20%) 0%, transparent 55%),
    linear-gradient(160deg, var(--brand) 0%, var(--action) 100%);
}

.auth-brand-logo { height: 34px; width: auto; }
.auth-brand-logo.tenant { height: 40px; background: #fff; padding: 6px 10px; border-radius: var(--radius-sm); }

.auth-brand-copy { position: relative; z-index: 1; max-width: 460px; }

.auth-brand-copy h1 {
  font-family: var(--font-heading);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  font-weight: 700;
}

.auth-brand-copy ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }

.auth-brand-copy li {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 15px;
  color: rgb(255 255 255 / 0.92);
}

.auth-brand-copy li::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* The three-node mark, large and faint, as the panel's motif. */
.auth-brand-mark {
  position: absolute;
  right: -90px;
  bottom: -70px;
  width: 420px;
  opacity: 0.12;
  pointer-events: none;
}

.auth-powered { position: relative; z-index: 1; margin: 0; font-size: 13px; color: rgb(255 255 255 / 0.8); }

/* ---- Form side ---------------------------------------------------------------------------- */
.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background:
    radial-gradient(800px 400px at 100% 0%, color-mix(in srgb, var(--brand) 7%, transparent) 0%, transparent 70%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 36px 28px;
}

.auth-card-logo { margin-bottom: 28px; }
.auth-card-logo img { height: 32px; width: auto; max-width: 220px; object-fit: contain; }

.auth-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

.auth-subtitle { margin: 4px 0 24px; color: var(--muted); }

.auth-help { margin: 24px 0 0; font-size: 13px; color: var(--subtle); text-align: center; }
.auth-help a, .auth-legal a, .hint a { color: var(--action); font-weight: 600; text-decoration: none; }
.auth-help a:hover, .auth-legal a:hover, .hint a:hover { text-decoration: underline; }

.auth-legal { margin-top: 20px; font-size: 12px; color: var(--subtle); }

/* ---- Tabs --------------------------------------------------------------------------------- */
.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: #F1F4F8;
  border-radius: 10px;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  font: 600 14px/1.2 var(--font-body);
  color: var(--muted);
  cursor: pointer;
}

.tab:hover { color: var(--ink); }

.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--action);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.08), 0 1px 3px rgb(16 24 40 / 0.06);
}

.tab:focus-visible, .btn:focus-visible, input:focus-visible, .company:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 2px;
}

/* ---- Fields & buttons --------------------------------------------------------------------- */
.panel { display: grid; gap: 16px; }
.panel[hidden] { display: none; }

.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text); }

.field-row { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }

input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font: 400 15px/1 var(--font-body);
  color: var(--ink);
  background: #fff;
  border: 1px solid #CDD5DF;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder { color: #9AA4B2; }

input:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

.code-input { font: 600 24px/1 var(--font-body); letter-spacing: 0.4em; text-align: center; height: 56px; }

.hint { margin: -4px 0 0; font-size: 13px; color: var(--subtle); }

.btn {
  appearance: none;
  height: 44px;
  border-radius: var(--radius-sm);
  font: 600 15px/1 var(--font-body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  border: 1px solid var(--action);
  background: var(--action);
  color: var(--on-action);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.08);
}

.btn-primary:hover { background: color-mix(in srgb, var(--action) 88%, #000); }

.btn-secondary { border: 1px solid #CDD5DF; background: #fff; color: var(--ink); }
.btn-secondary:hover { background: #F8FAFC; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--subtle); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---- Notices ------------------------------------------------------------------------------ */
.notice { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 20px; }
.notice-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #FECDCA; }
.notice-info { background: var(--info-bg); color: var(--info); border: 1px solid #B2DDFF; }

/* ---- Company picker ----------------------------------------------------------------------- */
.company-list { display: grid; gap: 10px; }

.company {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.company:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, #fff); }

.company-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 14%, #fff);
  color: var(--action);
  font: 700 16px/1 var(--font-heading);
}

.company-text { display: grid; flex: 1; }
.company-text small { color: var(--subtle); }
.company-chevron { font-size: 22px; color: var(--subtle); }

/* ---- Small screens: the form only ---------------------------------------------------------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-main { justify-content: flex-start; padding: 32px 16px; }
  .auth-card { padding: 28px 20px 20px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* 6N: second-factor pages */
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); }
.check input { width: auto; height: auto; }
.qr { width: 200px; margin: 12px auto; }
.qr svg { display: block; width: 100%; height: auto; }
.key { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.05em; word-break: break-word; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.codes code { font: 600 14px ui-monospace, Consolas, monospace; }
.ways { margin: 8px 0 16px; padding-left: 20px; font-size: 14px; color: var(--text); }
