* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, svg { display: block; }

:focus-visible {
  outline: 3px solid rgba(18, 201, 121, .32);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .045em;
  text-decoration: none;
  white-space: nowrap;
}

.brand em { color: var(--muted); font-style: normal; font-weight: 650; }

.brand-mark {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .105em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--text); color: #fff; }
.button-primary:hover { background: #242927; }
.button-accent { background: var(--accent); color: #06170f; }
.button-accent:hover { background: #16d985; }
.button-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.button-block { width: 100%; }
.button[disabled], .button[aria-disabled="true"] { cursor: not-allowed; opacity: .58; transform: none; }

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.icon-button:hover { background: var(--bg-elevated); transform: translateY(-1px); }

.field { display: grid; gap: 8px; }
.field > span:first-child { font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: #fff;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #bbc2bc; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(18, 201, 121, .1);
  outline: 0;
}

.alert {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 13px;
}
.alert-danger { background: var(--danger-soft); border-color: #f1caca; color: var(--danger-strong); }
.alert-warning { background: var(--warning-soft); border-color: #efcaca; color: var(--warning-strong); }
.alert-success { background: var(--accent-soft); border-color: #bdebd1; color: var(--accent-strong); }

.status-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #f0f2ef;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-success { background: var(--accent-soft); color: var(--accent-strong); }
.status-warning { background: var(--warning-soft); color: var(--warning-strong); }
.status-danger { background: var(--danger-soft); color: var(--danger-strong); }
.status-dark { background: var(--text); color: #fff; }

.auth-body { min-height: 100vh; }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.05fr) minmax(440px, .95fr); }
.auth-story {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 68px);
  overflow: hidden;
  position: relative;
}
.auth-story::after {
  content: "";
  position: absolute;
  top: 16%;
  right: -14%;
  width: min(36vw, 530px);
  aspect-ratio: 1;
  border: clamp(42px, 6vw, 90px) solid rgba(18, 201, 121, .16);
  border-radius: 50%;
  pointer-events: none;
}
.auth-story-copy { position: relative; z-index: 1; max-width: 690px; padding: 70px 0 40px; }
.auth-story-copy h1 {
  max-width: 650px;
  margin: 16px 0 22px;
  font-size: clamp(58px, 7.6vw, 118px);
  font-weight: 780;
  letter-spacing: -.07em;
  line-height: .84;
}
.auth-story-copy p { max-width: 500px; margin: 0; color: var(--text-soft); font-size: clamp(16px, 1.6vw, 21px); }
.auth-proof { display: grid; position: relative; z-index: 1; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border-strong); }
.auth-proof div { display: grid; gap: 20px; padding: 21px 18px 0 0; }
.auth-proof strong { font-size: 11px; }
.auth-proof span { max-width: 130px; color: var(--muted); font-size: 12px; }
.auth-story > small { position: relative; z-index: 1; margin-top: 40px; color: var(--muted); }
.auth-panel { display: grid; min-height: 100vh; place-items: center; padding: 32px; background: var(--surface); border-left: 1px solid var(--border); }
.auth-panel-inner { width: min(430px, 100%); }
.auth-panel h2 { margin: 13px 0 8px; font-size: clamp(32px, 4vw, 48px); letter-spacing: -.05em; line-height: 1; }
.auth-panel p { margin: 0 0 30px; }
.auth-form { display: grid; gap: 18px; }
.password-control { display: block; position: relative; }
.password-control input { padding-right: 62px; }
.password-toggle { position: absolute; top: 50%; right: 8px; min-width: 45px; height: 36px; transform: translateY(-50%); border: 0; border-radius: 11px; background: var(--bg); cursor: pointer; font-size: 11px; font-weight: 800; }
.demo-access { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-top: 28px; padding-top: 23px; border-top: 1px solid var(--border); }
.demo-access div { display: grid; }
.demo-access strong { font-size: 11px; }
.demo-access span { color: var(--muted); font-size: 10px; }
.demo-access button { min-height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 11px; background: #fff; cursor: pointer; font-size: 10px; font-weight: 750; }
.setup-link { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 11px; }

.error-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.error-card { width: min(630px, 100%); padding: clamp(28px, 6vw, 64px); border: 1px solid var(--border); border-radius: 28px; background: #fff; }
.error-card .eyebrow { display: block; margin: 34px 0 12px; }
.error-card h1 { margin: 0 0 17px; font-size: clamp(38px, 7vw, 68px); letter-spacing: -.055em; line-height: .95; }
.error-card p { max-width: 490px; margin: 0 0 28px; color: var(--muted); }

.toast-region { position: fixed; z-index: 2000; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.toast { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 13px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow-soft); animation: toast-in .3s ease both; }
.toast-dot { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong); }
.toast p { margin: 0; font-size: 12px; font-weight: 650; }
.toast-close { padding: 7px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: auto; padding: 28px; }
  .auth-story-copy { padding: 70px 0; }
  .auth-story-copy h1 { font-size: clamp(56px, 15vw, 92px); }
  .auth-proof { display: none; }
  .auth-panel { min-height: auto; padding: 50px 24px 64px; border-top: 1px solid var(--border); border-left: 0; }
}

@media (max-width: 520px) {
  .auth-story { min-height: 48vh; }
  .auth-story::after { top: 22%; right: -30%; width: 76vw; }
  .auth-story-copy { padding: 58px 0 16px; }
  .auth-story-copy h1 { font-size: clamp(48px, 16vw, 70px); }
  .auth-story > small { margin-top: 32px; }
  .auth-panel h2 { font-size: 38px; }
  .demo-access { grid-template-columns: 1fr 1fr; }
  .demo-access div { grid-column: 1 / -1; margin-bottom: 4px; }
}

/* Apple-inspired liquid glass foundation */
@keyframes liquid-background-drift {
  0%, 100% { background-position: 0% 20%, 100% 80%, 50% 50%; }
  50% { background-position: 14% 5%, 86% 96%, 50% 50%; }
}

body {
  background-color: #f8fbf9;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(25,212,127,.11), transparent 31%),
    radial-gradient(circle at 88% 92%, rgba(91,225,159,.09), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #f7fbf8 52%, #ffffff 100%);
  background-size: 145% 145%, 155% 155%, 100% 100%;
  animation: liquid-background-drift 20s ease-in-out infinite;
}

.button,
.icon-button,
.demo-access button,
.password-toggle {
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 10px 28px rgba(19,54,36,.10);
}

.button-primary {
  border-color: rgba(255,255,255,.18);
  background: rgba(13,18,15,.94);
}

.button-secondary,
.icon-button,
.demo-access button,
.password-toggle {
  background: rgba(255,255,255,.64);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.field input,
.field select { border-radius: 999px; background: rgba(255,255,255,.7); }
.field textarea { border-radius: 18px; background: rgba(255,255,255,.7); }

.profile-image,
.avatar-image,
[class*="avatar"] > img {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255,255,255,.94);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(12,35,22,.10), 0 10px 26px rgba(13,47,28,.16);
}

.brand-mark { border-radius: 50%; }

.toast {
  border-color: rgba(255,255,255,.78);
  border-radius: 20px;
  background: rgba(255,255,255,.68);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Premium visual system · 2026 */
.surface { box-shadow: var(--shadow-card); }
.button { letter-spacing: -.01em; box-shadow: 0 8px 22px rgba(13,16,15,.06); }
.button-primary { background: #101311; }
.button-accent { box-shadow: 0 12px 28px rgba(25,212,127,.2); }
.status-success::before, .status-warning::before, .status-danger::before, .status-dark::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}
.toast { border-color: rgba(16,19,17,.08); box-shadow: 0 24px 70px rgba(16,19,17,.16); }

@media (max-width: 520px) {
  .auth-story { min-height: 285px; padding: 20px; }
  .auth-story::after { top: 8%; right: -24%; width: 66vw; border-width: 34px; }
  .auth-story-copy { padding: 40px 0 12px; }
  .auth-story-copy h1 { max-width: 320px; margin: 10px 0 13px; font-size: 44px; line-height: .88; }
  .auth-story-copy p { max-width: 310px; font-size: 12px; }
  .auth-story > small { display: none; }
  .auth-panel { padding: 34px 20px 48px; }
  .auth-panel h2 { font-size: 33px; }
  .auth-panel p { margin-bottom: 24px; }
}
