:root {
  color-scheme: light;
  --cream: #fffdf8;
  --paper: #fffefa;
  --ink: #243b36;
  --muted: #62726d;
  --line: #e8dfd2;
  --brand: #6eb92b;
  --brand-deep: #2f6f1d;
  --error: #9a3448;
  --shadow: 0 22px 65px rgba(36, 59, 54, .12);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: #f2eee5;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--cream);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

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

.access-shell {
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(52px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: var(--cream);
}

.access-card {
  padding: 28px 24px 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  animation: card-in .42s ease-out both;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 28px;
  padding: 0 2px 22px;
  border-bottom: 1px solid var(--line);
}

.brand-logo,
.brand-tagline {
  display: block;
  height: auto;
}

.brand-logo {
  width: clamp(108px, 34vw, 124px);
}

.brand-tagline {
  width: min(43%, 140px);
}

.field-group + .field-group {
  margin-top: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.phone-field,
.code-field {
  display: flex;
  align-items: stretch;
}

.phone-field {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.phone-field:focus-within,
.code-field input:focus {
  border-color: var(--brand-deep);
  outline: 3px solid rgba(47, 111, 29, .13);
}

.dial-code {
  display: grid;
  min-width: 58px;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

input {
  min-width: 0;
  height: 52px;
  border: 0;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.phone-field input {
  flex: 1;
  padding: 0 15px;
}

input::placeholder {
  color: #8d9995;
}

input[aria-invalid="true"] {
  color: var(--error);
}

.code-field {
  gap: 10px;
}

.code-field input {
  width: 0;
  flex: 1;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  letter-spacing: .1em;
}

.send-button {
  width: 116px;
  min-height: 52px;
  border: 1px solid rgba(47, 111, 29, .3);
  border-radius: 14px;
  background: #f5faef;
  color: var(--brand-deep);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.send-button:hover:not(:disabled) {
  background: #edf7e4;
}

.send-button:focus-visible,
.enter-button:focus-visible {
  outline: 3px solid rgba(47, 111, 159, .22);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: .62;
}

.form-status {
  min-height: 24px;
  margin: 12px 2px 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.form-status[data-kind="error"] {
  color: var(--error);
}

.form-status[data-kind="success"] {
  color: var(--brand-deep);
}

.enter-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--brand-deep);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 9px 22px rgba(47, 111, 29, .2);
  cursor: pointer;
}

.enter-button:hover:not(:disabled) {
  background: #285f1a;
}

.support-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 360px) {
  .access-shell {
    padding-top: max(32px, env(safe-area-inset-top));
    padding-right: 16px;
    padding-left: 16px;
  }
  .access-card { padding-right: 18px; padding-left: 18px; }
  .brand-row { gap: 12px; }
  .send-button { width: 104px; font-size: 13px; }
}

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