/* ============================================================
   SERGO Design System SDS 26 — Keycloak Auth Flow Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ── Design Tokens ──────────────────────────────────────── */
:root {
  --green:        #015239;
  --green-hover:  #0B3F33;
  --green-pressed:#062E26;
  --green-soft:   #E6F2EF;
  --green-softer: #F3FAF6;
  --green-border: #1F6F5B;
  --border:       #E5E7EB;
  --border-strong:#D1D5DB;
  --bg:           #F9FAFB;
  --white:        #ffffff;
  --fg:           #111827;
  --fg-body:      #374151;
  --fg-muted:     #6B7280;
  --fg-quiet:     #9CA3AF;
  --error:        #8C2F39;
  --error-bg:     #F4E6E8;
  --error-border: #D9B6BB;
  --warn-text:    #92400E;
  --shadow:       0 1px 2px rgba(0,0,0,.05);
  --focus-ring:   0 0 0 3px rgba(1,82,57,.18);
  --r-sm:         4px;
  --r-md:         8px;
  --r-lg:         12px;
  --r-xl:         14px;
  --r-pill:       9999px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--green); text-decoration: none; }
a:hover,
a:focus,
a:focus-visible,
a:active {
  color: var(--green) !important;
  text-decoration: none !important;
  outline: none !important;
}
button:focus,
button:focus-visible { outline: none !important; box-shadow: none !important; }
button { font-family: inherit; }
*::selection { background: #CDE6DD; }

/* ── Split Layout ───────────────────────────────────────── */
.sds-split {
  display: grid;
  grid-template-columns: minmax(0, 58%) 1fr;
  min-height: 100vh;
}

/* ── Brand Panel (left) ─────────────────────────────────── */
.sds-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #075035;
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 44px 48px;
}

.sds-panel-logo { flex-shrink: 0; margin-bottom: 40px; position: relative; z-index: 3; }
.sds-panel-logo img { height: 28px; display: block; }

.sds-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.sds-panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #fff;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  margin-bottom: 20px;
  align-self: flex-start;
}

.sds-panel-badge svg { width: 14px; height: 14px; fill: currentColor; }

.sds-panel-title {
  margin: 0 0 12px;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.015em;
  text-shadow: 0 1px 12px rgba(4,20,12,.5);
  max-width: 460px;
}

.sds-panel-sub {
  margin: 0 0 28px;
  font-size: 15.5px;
  line-height: 1.55;
  color: rgba(255,255,255,.78);
  text-shadow: 0 1px 12px rgba(4,20,12,.5);
  max-width: 430px;
}

.sds-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.sds-panel-item { display: flex; align-items: center; gap: 13px; }

.sds-panel-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sds-panel-icon svg { width: 16px; height: 16px; fill: #fff; color: #fff; }

.sds-panel-item-label { font-size: 14px; font-weight: 600; color: #fff; }

/* ── Form Side (right) ──────────────────────────────────── */
.sds-form-side {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--white);
}

.sds-form-utility {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 22px 40px 0;
  min-height: 52px;
}

.sds-form-utility-content {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--fg-muted);
}

.sds-form-utility a,
.sds-link-btn {
  font-weight: 700;
  color: var(--green);
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.sds-form-utility a:hover, .sds-link-btn:hover { text-decoration: none; }

.sds-mobile-logo { display: none; }

.sds-form-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 40px 52px;
}

.sds-form-inner {
  width: 100%;
  max-width: 412px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ── Alerts ─────────────────────────────────────────────── */
.sds-alert {
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
}

.sds-alert--error   { background: var(--error-bg);  color: var(--error);    border-color: var(--error-border); }
.sds-alert--success { background: #E7F3EE; color: #2E7D5B; border-color: #A9D6C2; }
.sds-alert--warning { background: #FEF3C7; color: var(--warn-text); border-color: #FDE68A; }
.sds-alert--info    { background: #DBEAFE; color: #1E40AF; border-color: #BFDBFE; }

/* ── Form Head ───────────────────────────────────────────── */
.sds-form-head { display: flex; flex-direction: column; }

.sds-form-head-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-xl);
  background: var(--green-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: none !important;
  color: var(--green);
}

.sds-form-head-icon svg { width: 24px; height: 24px; fill: var(--green) !important; color: var(--green); }

.sds-form-head-icon--danger { background: var(--error-bg); color: var(--error); }
.sds-form-head-icon--danger svg { fill: var(--error) !important; color: var(--error); }

.sds-form-head h2 {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -.01em;
  line-height: 1.18;
}

.sds-form-head p { margin: 8px 0 0; font-size: 14.5px; color: var(--fg-muted); line-height: 1.45; }
.sds-form-head--sm { margin-bottom: 16px; }
.sds-form-head--sm h2 { font-size: 22px; }
.sds-form-head--sm p { font-size: 13px; margin-bottom: 0; }

/* Logo mark in form */
.sds-form-logo { display: block; width: 34px; height: 34px; margin-bottom: 18px; }

/* ── Fields ──────────────────────────────────────────────── */
.sds-field { display: flex; flex-direction: column; gap: 7px; }

.sds-label { font-size: 13px; font-weight: 600; color: var(--fg-body); margin-bottom: 0; }
.sds-required { color: var(--error); margin-left: 3px; }
.sds-field-hint { font-size: 12px; color: var(--fg-muted); line-height: 16px; }

.sds-tab-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--bg-muted, #F3F4F6);
  border-radius: var(--r-lg);
}

.sds-tab-switch a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 120ms ease;
}

.sds-tab-switch a svg { width: 15px; height: 15px; fill: currentColor; color: currentColor; }

.sds-tab-switch a.is-active { color: var(--green); background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.10); }
.sds-tab-switch a.is-inactive { color: var(--fg-muted); background: transparent; }
.sds-tab-switch a.is-inactive svg { color: var(--fg-quiet); }
.sds-tab-switch a.is-inactive:hover { color: var(--fg-body); text-decoration: none; }

.sds-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.sds-input-wrap:focus-within {
  border-color: var(--green-border);
  box-shadow: 0 0 0 3px rgba(1,82,57,.12);
}

.sds-input-wrap.is-error { border-color: var(--error); }

.sds-input-icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  pointer-events: none;
  color: var(--fg-quiet);
}

.sds-input-icon svg { width: 14px; height: 14px; fill: currentColor; }

.sds-input-wrap input {
  flex: 1;
  height: 44px;
  border: 0;
  background: transparent;
  outline: none;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--fg);
  min-width: 0;
}

.sds-input-wrap input.with-icon { padding-left: 36px !important; }
.sds-input-wrap input::placeholder { color: var(--fg-quiet); }

.sds-select-wrap { position: relative; }

.sds-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.sds-select-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  pointer-events: none;
  color: var(--fg-quiet);
}

.sds-pwd-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  color: var(--fg-quiet);
  flex-shrink: 0;
}

.sds-pwd-toggle:hover { color: var(--green); }
.sds-pwd-toggle svg { width: 16px; height: 16px; fill: currentColor; }

.sds-field-error { font-size: 12px; font-weight: 600; color: var(--error); line-height: 1.4; }

/* ── Buttons ──────────────────────────────────────────────── */
.sds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}

.sds-btn--primary {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  background: var(--green);
  color: #fff;
  width: 100%;
}

.sds-btn--primary:hover:not(:disabled) { background: var(--green); color: #fff !important; }
.sds-btn--primary:active:not(:disabled) { background: var(--green-pressed); }
.sds-btn--primary:disabled { opacity: .55; cursor: not-allowed; }
.sds-btn--primary svg { width: 18px; height: 18px; fill: currentColor; }

.sds-btn--sso {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  font-size: 13px;
  background: var(--white);
  color: var(--fg-body);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.sds-btn--sso:hover { background: var(--bg); color: var(--fg-body) !important; text-decoration: none !important; }
.sds-btn--sso:focus,
.sds-btn--sso:focus-visible { outline: none; box-shadow: none; }
.sds-btn--sso svg { width: 18px; height: 18px; flex-shrink: 0; }

.sds-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green);
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  width: 100%;
  margin-top: 8px;
}

.sds-back:hover { text-decoration: none; }
.sds-back svg { width: 15px; height: 15px; fill: currentColor; }

/* ── Divider ──────────────────────────────────────────────── */
.sds-divider {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sds-divider::before,
.sds-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sds-divider span { font-size: 12px; color: var(--fg-quiet); font-weight: 500; white-space: nowrap; }

.sds-sso-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* ── Checkbox ─────────────────────────────────────────────── */
.sds-check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--fg-muted);
  cursor: pointer;
  line-height: 1.4;
}

.sds-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  flex-shrink: 0;
  cursor: pointer;
}

.sds-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sds-forgot-link { font-size: 13px; font-weight: 600; color: var(--green); }

/* ── OTP 6-digit grid ────────────────────────────────────── */
.sds-otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.sds-otp-cell {
  height: 58px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color 120ms ease, background 120ms ease;
  caret-color: var(--green);
  width: 100%;
  padding: 0;
}

.sds-otp-cell:focus {
  border-color: var(--green-border);
  box-shadow: 0 0 0 3px rgba(1,82,57,.12);
}

.sds-otp-cell.filled {
  border-color: var(--green-border);
  background: var(--green-softer);
}

/* ── Password strength ──────────────────────────────────── */
.sds-strength { display: flex; flex-direction: column; gap: 7px; }

.sds-strength-bars { display: flex; gap: 6px; }

.sds-strength-bar {
  flex: 1;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--border);
  transition: background 180ms ease;
}

.sds-strength-bar.weak   { background: #D97706; }
.sds-strength-bar.fair   { background: #D97706; }
.sds-strength-bar.good   { background: var(--green); }
.sds-strength-bar.strong { background: var(--green); }

.sds-strength-label { font-size: 12px; font-weight: 600; color: var(--fg-quiet); min-height: 16px; }

/* ── Requirements list ──────────────────────────────────── */
.sds-reqs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sds-req {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--fg-quiet);
  font-weight: 500;
  transition: color 150ms ease;
}

.sds-req.met { color: var(--green); font-weight: 600; }

.sds-req-dot {
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: #F3F4F6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 150ms ease;
}

.sds-req.met .sds-req-dot { background: var(--green); border-color: var(--green); }

.sds-req-dot svg { width: 10px; height: 10px; }
.sds-req-dot svg path { fill: none; stroke: transparent; }
.sds-req.met .sds-req-dot svg path { stroke: #fff; }

/* ── QR code box ─────────────────────────────────────────── */
.sds-qr-wrap { display: flex; justify-content: center; padding: 4px 0; }

.sds-qr-box {
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  display: inline-block;
}

.sds-qr-box img { display: block; width: 180px; height: 180px; image-rendering: pixelated; }

.sds-manual-key {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.sds-manual-key code {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--fg);
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sds-manual-key svg { width: 15px; height: 15px; fill: var(--green); flex-shrink: 0; }
.sds-manual-key-lbl { font-size: 11px; color: var(--fg-muted); font-weight: 500; white-space: nowrap; }

/* App list */
.sds-app-list { display: flex; flex-direction: column; gap: 8px; }

.sds-app-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.sds-app-item svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── User badge ──────────────────────────────────────────── */
.sds-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: var(--green-soft);
  border: 1px solid #c6ddd5;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
  align-self: flex-start;
}

.sds-user-badge svg { width: 13px; height: 13px; fill: currentColor; }

/* ── Processing / verifying screen ───────────────────────── */
@keyframes sds-spin { to { transform: rotate(360deg); } }

.sds-processing {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sds-processing.is-visible { display: flex; }

.sds-processing-ring-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sds-processing-ring-wrap svg { position: absolute; inset: 0; animation: sds-spin 1s linear infinite; }

.sds-processing-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.sds-processing h2 { margin: 0; font-size: 24px; font-weight: 700; color: var(--fg); letter-spacing: -0.01em; }
.sds-processing p { margin: 10px 0 26px; font-size: 14.5px; color: var(--fg-muted); line-height: 21px; max-width: 340px; }

.sds-processing-secure { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-quiet); }
.sds-processing-secure svg { width: 13px; height: 13px; fill: currentColor; }

.sds-processing-cancel {
  margin-top: 24px;
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green);
}

.sds-processing-cancel svg { width: 14px; height: 14px; fill: currentColor; }

/* Resend row */
.sds-resend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-muted);
}

.sds-resend-btn {
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sds-resend-btn:hover { text-decoration: none; }
.sds-resend-btn svg { width: 12px; height: 12px; fill: currentColor; }
.sds-resend-timer { font-variant-numeric: tabular-nums; }

.sds-wrong-account {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  font-size: 13px;
  color: var(--fg-muted);
}

/* Notice */
.sds-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-quiet);
  text-align: center;
  line-height: 1.5;
}

/* ── Try another way ─────────────────────────────────────── */
.sds-try-another {
  text-align: center;
  font-size: 13px;
}

.sds-try-another a { font-weight: 600; color: var(--green); }

/* ── Done-screen animations ──────────────────────────────── */
@keyframes pulseRing {
  0%   { transform: scale(.85); opacity: .6; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { opacity: 0; }
}

@keyframes drawCheck {
  from { stroke-dashoffset: 30; }
  to   { stroke-dashoffset: 0; }
}

/* ── Two-Factor Auth intro ───────────────────────────────── */
.tfa-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.tfa-app-section { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; margin-bottom: 20px; }
.tfa-manual-section { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.tfa-manual-label { margin: 0; font-size: 12px; font-weight: 600; color: var(--fg-quiet); }
.tfa-app-section-label { font-size: 12px; font-weight: 600; color: var(--fg-quiet); margin-bottom: 4px; }

.sds-app-item--check { justify-content: space-between; }
.tfa-app-left { display: flex; align-items: center; gap: 12px; }

.tfa-app-check {
  flex-shrink: 0;
  display: block;
  color: var(--green);
}
.sds-app-item svg.tfa-app-check { width: 15px; height: 15px; }

.tfa-app-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 0;
  font-size: 12.5px;
  color: var(--fg-muted);
  line-height: 18px;
}

.tfa-app-info-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  line-height: 0;
  align-items: center;
  justify-content: center;
  color: var(--fg-quiet);
  flex-shrink: 0;
}

/* Ghost button for secondary wizard actions */
.sds-btn--ghost {
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  background: transparent;
  color: var(--green);
  border-color: transparent;
  width: 100%;
  font-weight: 600;
  margin-top: 16px;
}
.sds-btn--ghost:hover { background: var(--bg); color: var(--green) !important; }

/* Tertiary button for secondary actions next to a primary CTA (e.g. Abbrechen / Bestätigen) */
.sds-btn--tertiary {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  background: var(--white);
  color: var(--fg-body);
  border-color: var(--border);
  box-shadow: var(--shadow);
  width: auto;
}
.sds-btn--tertiary:hover { background: var(--bg); color: var(--fg-body) !important; }

/* ── Tenant / workspace chooser ──────────────────────────── */
.sds-form-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}

.sds-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.sds-user-chip-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--green-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sds-user-chip-icon svg { width: 13px; height: 13px; fill: var(--green); color: var(--green); }
.sds-user-chip b { color: var(--fg-body); font-weight: 700; }

.sds-utility-split { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; }
.sds-utility-step { color: var(--fg-quiet); white-space: nowrap; }

.sds-tenant-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.sds-tenant-logout:hover { text-decoration: none; color: var(--green); }

/* Tenant screens (select/create/accept-invitation): stretch the utility row full-width
   so the chip and the logout button land at opposite corners instead of huddling together. */
.sds-form-utility-content:has(.sds-select-utility-split),
.sds-form-utility-content:has(.sds-create-utility-split),
.sds-form-utility-content:has(.sds-invite-utility-split) {
  flex: 1;
}

.sds-match-found {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}

.sds-match-found svg { width: 14px; height: 14px; fill: var(--green); color: var(--green); }
.sds-match-found b { color: var(--fg-body); }

.sds-match-list { display: flex; flex-direction: column; gap: 10px; }

.sds-match-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--white);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 120ms ease;
}

.sds-match-row:hover { background: var(--green-softer); border-color: var(--green-border); }

.sds-company-tile {
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
}

.sds-company-tile--logo {
  background: var(--white);
  border: 1px solid var(--border);
  overflow: hidden;
}

.sds-company-tile--logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.sds-tile-tone-0 { background: #E6F2EF; color: #015239; }
.sds-tile-tone-1 { background: #EAF0FB; color: #2A4B8D; }
.sds-tile-tone-2 { background: #FBEFEA; color: #9A4A2C; }
.sds-tile-tone-3 { background: #F1ECFB; color: #5B3E9A; }

.sds-company-info { flex: 1; min-width: 0; }

.sds-company-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sds-company-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-muted);
  margin-top: 2px;
}

.sds-company-sub-dot { color: var(--border-strong); }

.sds-match-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--green);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  flex-shrink: 0;
  pointer-events: none;
}

.sds-match-cta svg { width: 14px; height: 14px; fill: currentColor; }

.sds-option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--white);
  border: 1.5px dashed var(--border-strong);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  transition: all 120ms ease;
}

.sds-option-row:hover { background: var(--bg); border-color: var(--fg-quiet); text-decoration: none; }

.sds-option-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-muted, #F3F4F6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sds-option-icon svg { width: 17px; height: 17px; fill: var(--fg-muted); color: var(--fg-muted); }

.sds-option-text { flex: 1; min-width: 0; }
.sds-option-title { display: block; font-size: 14px; font-weight: 700; color: var(--fg); }
.sds-option-desc { display: block; font-size: 12.5px; color: var(--fg-muted); margin-top: 2px; }
.sds-option-chevron { flex-shrink: 0; width: 16px; height: 16px; fill: var(--fg-quiet); color: var(--fg-quiet); }

/* ── Tenant pages: brand panel product shot + steps ──────── */
.sds-page-tenant .sds-panel {
  background-image: url('../images/macbook.png');
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100%;
}

.sds-page-tenant .sds-form-inner { max-width: 468px; }

.sds-page-tenant .sds-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgb(10,44,29) 0%, rgb(10,44,29) 39%, rgba(10,44,29,0.82) 49%, rgba(11,48,32,0.24) 61%, transparent 75%);
  pointer-events: none;
  z-index: 1;
}

.sds-panel-steps {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sds-step-item { display: flex; align-items: center; gap: 12px; opacity: 0.5; }
.sds-step-item.is-done, .sds-step-item.is-active { opacity: 1; }

.sds-step-dot {
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.14);
}

.sds-step-item.is-done .sds-step-dot { background: rgba(255,255,255,.9); }
.sds-step-item.is-active .sds-step-dot {
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.14);
}

.sds-step-dot svg { width: 13px; height: 13px; fill: #075035; color: #075035; }
.sds-step-dot span { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.8); }
.sds-step-item.is-active .sds-step-dot span { color: #0a2c1d; }

.sds-step-label { font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,.82); }
.sds-step-item.is-active .sds-step-label { font-weight: 700; color: #fff; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 920px) {
  .sds-split { grid-template-columns: 1fr; }
  .sds-panel { display: none; }
  .sds-form-utility { padding: 18px 24px 0; justify-content: space-between; }
  .sds-form-center { padding: 20px 24px 44px; }
  .sds-mobile-logo { display: flex; align-items: center; flex-shrink: 0; }
  .sds-mobile-logo img { height: 20px; display: block; }
  .sds-form-utility-content { font-size: 11px; }
  .sds-form-utility-content a,
  .sds-form-utility-content .sds-link-btn { font-size: 11px; }
  .sds-sso-row { gap: 8px; }
  .sds-btn--sso { padding: 0 6px; font-size: 12px; }
}

@media (max-width: 767px) {
  .sds-select-chip-label { display: none; }
  .sds-select-utility-split { gap: 0; }
  .sds-create-chip-label { display: none; }
  .sds-create-utility-split { gap: 0; }
  .sds-invite-chip-label { display: none; }
  .sds-invite-utility-split { gap: 0; }

  /* Tenant screens: flatten the nested utility wrappers so the logo, the logout
     button and the user chip become direct flex items of the same row and can
     be reordered/wrapped independently -- logo + button stay on row 1, the
     chip drops to its own full-width row 2 underneath. */
  .sds-form-utility-content:has(.sds-select-utility-split),
  .sds-form-utility-content:has(.sds-create-utility-split),
  .sds-form-utility-content:has(.sds-invite-utility-split) {
    display: contents;
  }
  .sds-select-utility-split,
  .sds-create-utility-split,
  .sds-invite-utility-split {
    display: contents;
  }
  .sds-form-utility:has(.sds-select-utility-split),
  .sds-form-utility:has(.sds-create-utility-split),
  .sds-form-utility:has(.sds-invite-utility-split) {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .sds-tenant-logout { order: 2; }
  .sds-user-chip { order: 3; flex: 1 0 100%; }
}
