@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700&family=Inter:wght@400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --ink:     #0F172A;
  --blue:    #2563EB;
  --blue-dk: #1D4ED8;
  --amber:   #F59E0B;
  --surface: #F1F5F9;
  --text:    #0F172A;
  --muted:   #64748B;
  --border:  #E2E8F0;
  --error:   #DC2626;
  --ok:      #059669;
  --radius:  12px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
}

/* ── Split layout ────────────────────────────────────────────────────────── */
.auth-split {
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: 100vh;
}

/* ── Brand panel (left) ──────────────────────────────────────────────────── */
.auth-brand {
  background: linear-gradient(160deg, #0C1822 0%, #14304A 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.auth-brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: contain;
  margin-bottom: 24px;
}

.auth-brand h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  text-align: center;
  line-height: 1.1;
}

.auth-brand-tagline {
  color: rgba(255,255,255,.6);
  font-size: .95rem;
  margin-top: 8px;
  text-align: center;
}

.auth-brand-badge {
  display: inline-block;
  background: transparent;
  border: 1.5px solid var(--amber);
  color: var(--amber);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-top: 12px;
}

/* ── Analog clock ────────────────────────────────────────────────────────── */
.auth-clock {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.15);
  margin: 32px auto 0;
  flex-shrink: 0;
}

.auth-clock-center {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.auth-clock .hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 4px;
}

.auth-clock .hand-hour {
  width: 4px;
  height: 44px;
  background: rgba(255,255,255,.9);
  margin-left: -2px;
}

.auth-clock .hand-min {
  width: 3px;
  height: 60px;
  background: rgba(255,255,255,.75);
  margin-left: -1.5px;
}

.auth-clock .hand-sec {
  width: 1.5px;
  height: 66px;
  background: var(--amber);
  margin-left: -.75px;
}

/* Hour tick marks */
.auth-clock::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      rgba(255,255,255,.25) 0deg 2deg,
      transparent 2deg 30deg
    );
}

/* ── Form panel (right) ──────────────────────────────────────────────────── */
.auth-form-panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  margin-bottom: 6px;
}

.auth-card-sub {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 28px;
}

/* ── Form controls ───────────────────────────────────────────────────────── */
.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: .95rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  background: #fff;
  color: var(--text);
  transition: border-color .15s;
}

.auth-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29,91,240,.1);
}

.auth-input.is-valid   { border-color: var(--ok); }
.auth-input.is-invalid { border-color: var(--error); }

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .auth-input {
  padding-right: 44px;
}

.auth-input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  font-size: 1.1rem;
  background: none;
  border: none;
  padding: 4px;
}

.auth-inline-msg {
  font-size: .78rem;
  margin-top: 5px;
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.auth-inline-msg.ok    { color: var(--ok); }
.auth-inline-msg.err   { color: var(--error); }
.auth-inline-msg.info  { color: var(--muted); }

/* ── Company chip (return visit) ─────────────────────────────────────────── */
.auth-company-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 20px;
}

.auth-company-chip-name {
  font-weight: 600;
  font-size: .95rem;
  color: var(--blue);
  flex: 1;
}

.auth-company-chip-change {
  font-size: .8rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.auth-company-chip-change:hover { color: var(--text); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.auth-btn {
  width: 100%;
  height: 46px;
  background: var(--blue);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, opacity .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.auth-btn:hover:not(:disabled)   { background: var(--blue-dk); }
.auth-btn:disabled                { opacity: .6; cursor: not-allowed; }

.auth-btn-ghost {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--border);
  width: 100%;
  height: 44px;
  font-size: .9rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s;
  margin-top: 10px;
}

.auth-btn-ghost:hover { border-color: var(--blue); }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}

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

/* ── Error banner ────────────────────────────────────────────────────────── */
.auth-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .87rem;
  margin-bottom: 18px;
  display: none;
}

.auth-error.show { display: block; }

/* ── Links & footer ──────────────────────────────────────────────────────── */
.auth-links {
  text-align: center;
  margin-top: 20px;
  font-size: .87rem;
  color: var(--muted);
}

.auth-links a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.auth-links a:hover { text-decoration: underline; }

.auth-footer {
  margin-top: 32px;
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
}

/* ── Step indicator ──────────────────────────────────────────────────────── */
.auth-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}

.auth-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--muted);
}

.auth-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-step.active .auth-step-num {
  background: var(--blue);
  color: #fff;
}

.auth-step.active { color: var(--text); font-weight: 500; }

.auth-step.done .auth-step-num {
  background: var(--ok);
  color: #fff;
}

.auth-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
}

/* ── Password strength ───────────────────────────────────────────────────── */
.auth-strength-bar {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.auth-strength-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background .2s;
}

.auth-strength-seg.weak   { background: var(--error); }
.auth-strength-seg.fair   { background: var(--amber); }
.auth-strength-seg.strong { background: var(--ok); }

.auth-strength-label {
  font-size: .75rem;
  margin-top: 4px;
  color: var(--muted);
}

/* ── Timezone search ─────────────────────────────────────────────────────── */
.auth-tz-wrap {
  position: relative;
}

.auth-tz-search {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  font-size: .85rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  outline: none;
  background: var(--surface);
  color: var(--text);
}

.auth-tz-search:focus { border-color: var(--blue); }

.auth-tz-select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: .9rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  outline: none;
  background: #fff;
  color: var(--text);
}

/* ── Checkbox ────────────────────────────────────────────────────────────── */
.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .85rem;
  color: var(--muted);
  margin: 14px 0;
}

.auth-check input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--blue);
}

/* ── Success state ───────────────────────────────────────────────────────── */
.auth-success {
  text-align: center;
  padding: 16px 0;
}

.auth-success-icon {
  width: 64px;
  height: 64px;
  background: #D1FAE5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
}

.auth-success h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.auth-success p { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }

.auth-slug-badge {
  display: inline-block;
  background: #EFF6FF;
  color: var(--blue);
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .9rem;
  font-weight: 600;
  margin: 12px 0 20px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-brand {
    position: static;
    height: auto;
    flex-direction: row;
    padding: 16px 20px;
    gap: 12px;
    justify-content: flex-start;
  }

  .auth-brand h1 { font-size: 1.3rem; }
  .auth-brand-tagline { display: none; }
  .auth-clock { display: none; }
  .auth-brand-badge { display: none; }

  .auth-form-panel {
    padding: 28px 20px;
    justify-content: flex-start;
  }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .auth-spinner { animation: none; border-top-color: rgba(255,255,255,.8); }
  .auth-clock .hand { transition: none; }
}
