:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17202a;
  background: #eef2f4;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(143, 47, 47, 0.10), transparent 30rem),
    linear-gradient(180deg, #f7f8f8 0%, #edf1f3 100%);
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.landing-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  box-shadow: 0 8px 20px rgba(16, 47, 88, .18);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; }
.brand small { margin-top: 2px; color: #68727b; font-size: .78rem; }

.language-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #56616b;
  font-size: .86rem;
}

.language-picker select {
  min-width: 108px;
  padding: 8px 10px;
  border: 1px solid #cbd2d8;
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  color: #17202a;
}

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, .72fr);
  gap: clamp(42px, 7vw, 92px);
  align-items: center;
  padding: 54px 0 72px;
}

.hero-copy { max-width: 720px; }
.eyebrow {
  margin: 0 0 12px;
  color: #873838;
  font-size: .78rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 780;
}

.lead {
  max-width: 680px;
  margin: 26px 0 0;
  color: #56616b;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.7;
}

.feature-grid {
  display: grid;
  gap: 16px;
  margin-top: 38px;
}

.feature-grid article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
}

.feature-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #7e3030;
  background: #f4e7e7;
  font-size: 1.15rem;
  font-weight: 800;
}

.feature-grid strong { font-size: .96rem; }
.feature-grid p {
  margin: 4px 0 0;
  color: #66717b;
  font-size: .91rem;
  line-height: 1.55;
}

.auth-card {
  width: 100%;
  padding: 28px;
  border: 1px solid rgba(133, 143, 151, .24);
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 80px rgba(35, 42, 47, .12);
  backdrop-filter: blur(14px);
}

.auth-heading h2 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: -.03em;
}

.auth-heading > p:last-child {
  margin: 8px 0 22px;
  color: #66717b;
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 20px;
  padding: 4px;
  border-radius: 10px;
  background: #eef1f3;
}

.auth-tabs button {
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64707a;
  cursor: pointer;
  font-weight: 700;
}

.auth-tabs button[aria-selected="true"] {
  background: #fff;
  color: #222a31;
  box-shadow: 0 1px 5px rgba(25, 34, 42, .10);
}

.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-size: .88rem; font-weight: 650; color: #45515b; }
.auth-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd2d8;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #17202a;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-form input:focus {
  border-color: #9b4a4a;
  box-shadow: 0 0 0 3px rgba(142, 58, 58, .12);
}

.primary {
  margin-top: 4px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  background: #813535;
  color: white;
  cursor: pointer;
  font-weight: 750;
  box-shadow: 0 8px 22px rgba(103, 35, 35, .18);
}
.primary:hover { background: #702d2d; }
.primary:disabled { opacity: .62; cursor: wait; }

.second-factor {
  margin-top: -2px;
  padding: 0;
  color: #5d6872;
  font-size: .85rem;
}
.second-factor summary { cursor: pointer; font-weight: 700; }
.second-factor[open] { display: grid; gap: 12px; }
.second-factor[open] summary { margin-bottom: 2px; }

.hint {
  margin: -4px 0 0;
  color: #747e87;
  font-size: .78rem;
  line-height: 1.45;
}

.message {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f0f6ee;
  color: #355b2d;
  font-size: .84rem;
  line-height: 1.45;
}
.message.error { background: #faecec; color: #7f2828; }

.account-links {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e2e6e9;
  text-align: center;
}
.account-links a { color: #6e3434; font-size: .83rem; font-weight: 700; }

footer {
  padding: 18px 0 28px;
  color: #77818a;
  font-size: .78rem;
  border-top: 1px solid rgba(136, 146, 154, .18);
}

.application-host {
  position: fixed;
  inset: 0;
  background: #f4f5f6;
}
#out { width: 100%; height: 100%; }
.startup-status {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: #f4f5f6;
  color: #404a53;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d4dadd;
  border-top-color: #813535;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

[hidden] { display: none !important; }

@media (max-width: 860px) {
  .landing-shell { width: min(100% - 28px, 720px); }
  .hero { grid-template-columns: 1fr; padding: 34px 0 50px; gap: 44px; }
  .hero-copy { max-width: none; }
  h1 { font-size: clamp(2.5rem, 11vw, 4.4rem); }
  .auth-card { max-width: 560px; }
}

@media (max-width: 520px) {
  .topbar { align-items: flex-start; padding-top: 18px; }
  .brand small { display: none; }
  .language-picker { display: grid; gap: 3px; }
  .auth-card { padding: 22px 18px; border-radius: 14px; }
}

@media (prefers-color-scheme: dark) {
  :root { color: #edf1f3; background: #15191c; }
  body { background: radial-gradient(circle at 12% 8%, rgba(151, 56, 56, .16), transparent 30rem), #171b1e; }
  .brand small, .lead, .feature-grid p, .auth-heading > p:last-child, .hint, footer { color: #aeb7be; }
  .language-picker { color: #bec6cc; }
  .language-picker select, .auth-form input { background: #1d2327; color: #edf1f3; border-color: #414a51; }
  .auth-card { background: rgba(28, 33, 37, .94); border-color: #363e44; box-shadow: 0 24px 80px rgba(0,0,0,.32); }
  .auth-tabs { background: #272d32; }
  .auth-tabs button { color: #aeb6bc; }
  .auth-tabs button[aria-selected="true"] { background: #353c42; color: #fff; }
  .auth-form label, .startup-status { color: #d5dce0; }
  .feature-icon { background: #3c2929; color: #dc9999; }
  .account-links { border-color: #384047; }
  .account-links a { color: #e0a2a2; }
  .application-host, .startup-status { background: #161a1d; }
}
