:root {
  color-scheme: dark;
  --bg: #030916;
  --text: #f7fbfd;
  --muted: #9ba9ba;
  --line: rgba(130, 165, 185, 0.34);
  --accent: #38b4c1;
  --accent-bright: #63d4dd;
  --error: #f2a8a8;
  font-family: Inter, "SF Pro Display", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.gate-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 50% 50%;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg) url("/gate/gate-desktop.webp") center / cover no-repeat;
}

.access-panel {
  grid-column: 2;
  width: min(36vw, 530px);
  min-width: 440px;
  margin-left: clamp(28px, 4vw, 72px);
  transform: translateY(-1.5vh);
}

.eyebrow {
  margin: 0 0 23px;
  color: rgba(247, 251, 253, 0.92);
  font-size: clamp(11px, 0.92vw, 14px);
  font-weight: 500;
  letter-spacing: 0.58em;
  line-height: 1.4;
  white-space: nowrap;
}

.heading-rule {
  position: relative;
  height: 1px;
  margin-bottom: 43px;
  background: rgba(80, 154, 165, 0.42);
}

.heading-rule span {
  position: absolute;
  inset: -1px auto auto 0;
  width: 74px;
  height: 2px;
  background: var(--accent-bright);
}

h1 {
  margin: 0 0 48px;
  color: #fff;
  font-size: clamp(42px, 3.35vw, 56px);
  font-weight: 550;
  letter-spacing: 0.15em;
  line-height: 1.16;
}

form {
  width: 100%;
}

label {
  display: block;
  margin: 0 0 17px;
  color: rgba(247, 251, 253, 0.9);
  font-size: clamp(18px, 1.42vw, 23px);
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 1.5;
}

input,
button {
  width: 100%;
  min-height: 70px;
  border-radius: 4px;
  font: inherit;
}

input {
  appearance: none;
  border: 1px solid rgba(95, 208, 221, 0.62);
  outline: 0;
  background: rgba(7, 22, 40, 0.56);
  box-shadow: 0 0 0 1px rgba(57, 181, 196, 0.08), 0 0 20px rgba(31, 155, 184, 0.13);
  padding: 0 20px;
  color: var(--text);
  caret-color: var(--accent-bright);
  font-size: 19px;
  letter-spacing: 0.03em;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input::placeholder {
  color: #7d899a;
  opacity: 1;
}

input:hover {
  border-color: rgba(99, 212, 221, 0.82);
}

input:focus-visible {
  border-color: var(--accent-bright);
  background: rgba(8, 25, 45, 0.7);
  box-shadow: 0 0 0 2px rgba(99, 212, 221, 0.19), 0 0 22px rgba(31, 155, 184, 0.19);
}

.error-message {
  min-height: 28px;
  margin: 8px 0 0;
  color: var(--error);
  font-size: 14px;
  letter-spacing: 0.02em;
  line-height: 20px;
}

.form-rule {
  height: 1px;
  margin: 0 0 34px;
  background: var(--line);
}

button {
  appearance: none;
  border: 0;
  outline: 0;
  background: linear-gradient(100deg, #2ea8b7 0%, #50c2cc 100%);
  box-shadow: 0 8px 26px rgba(17, 150, 174, 0.14);
  color: #fff;
  cursor: pointer;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0.12em;
  transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 10px 30px rgba(17, 150, 174, 0.22);
}

button:focus-visible {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-bright);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

@media (max-width: 900px) {
  .gate-shell {
    grid-template-columns: 43% 57%;
  }

  .access-panel {
    width: min(44vw, 500px);
    min-width: 390px;
    margin-left: 3vw;
  }
}

@media (max-width: 720px) {
  .gate-shell {
    display: block;
    min-height: 100svh;
    background-image: url("/gate/gate-mobile.webp");
    background-position: center top;
    background-size: cover;
    padding: max(36svh, 275px) 27px 48px;
  }

  .access-panel {
    width: 100%;
    min-width: 0;
    margin: 0;
    transform: none;
  }

  .eyebrow {
    margin-bottom: 20px;
    font-size: clamp(11px, 3.6vw, 14px);
    letter-spacing: 0.34em;
    text-align: center;
  }

  .heading-rule {
    width: 76px;
    margin: 0 auto 24px;
    background: var(--accent);
  }

  .heading-rule span {
    display: none;
  }

  h1 {
    margin-bottom: clamp(42px, 7svh, 62px);
    color: var(--accent);
    font-size: clamp(28px, 8.2vw, 36px);
    font-weight: 500;
    letter-spacing: 0.18em;
    text-align: center;
  }

  label {
    margin-bottom: 13px;
    font-size: 17px;
  }

  input,
  button {
    min-height: 62px;
  }

  input {
    padding: 0 17px;
    font-size: 18px;
  }

  .error-message {
    min-height: 26px;
    margin-top: 7px;
    font-size: 13px;
  }

  .form-rule {
    margin-bottom: 30px;
  }

  button {
    font-size: 19px;
  }
}

@media (max-height: 560px) and (min-width: 721px) {
  .access-panel {
    transform: none;
  }

  .eyebrow {
    margin-bottom: 12px;
  }

  .heading-rule {
    margin-bottom: 18px;
  }

  h1 {
    margin-bottom: 22px;
    font-size: 32px;
  }

  label {
    margin-bottom: 8px;
    font-size: 16px;
  }

  input,
  button {
    min-height: 50px;
  }

  .error-message {
    min-height: 20px;
    margin-top: 4px;
  }

  .form-rule {
    margin-bottom: 18px;
  }
}

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