:root {
  color-scheme: light;
  --bg: #f3f0e9;
  --surface: #fbf9f4;
  --border: #cec7ba;
  --text: #292724;
  --text-secondary: #615d56;
  --accent: #9a702c;
  --accent-hover: #7f5b22;
  --accent-soft: #9a702c18;
  --danger: #9d4f4f;
  --shadow: 0 20px 52px rgba(41, 39, 36, 0.16);
  --font-sans: Inter, Manrope, Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, ui-serif, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1012;
    --surface: #1c1d21;
    --border: #34353a;
    --text: #e8e4dc;
    --text-secondary: #aaa69e;
    --accent: #c79a43;
    --accent-hover: #d8ad58;
    --accent-soft: #c79a4320;
    --danger: #b65f5f;
    --shadow: 0 20px 52px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
}

.gateway-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.gateway-panel {
  position: relative;
  width: min(410px, 100%);
  display: grid;
  gap: 18px;
  padding: 23px 24px 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: enter 220ms ease-out;
}

.gateway-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 1px;
  background: var(--accent);
}

.gateway-logo {
  position: relative;
  width: 184px;
  height: 184px;
  margin: -13px auto -19px;
}

.gateway-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-for-dark { display: none; }

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  text-align: center;
}

label { display: grid; gap: 6px; }

label span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

input,
button {
  min-height: 38px;
  border-radius: 6px;
  color: inherit;
  font: inherit;
}

input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

input:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #0f1012;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--accent-hover); }

.gateway-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 11px;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .logo-for-light { display: none; }
  .logo-for-dark { display: block; }
}

@keyframes enter {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; }
}
