:root {
  color-scheme: light;
  --ink: #24332d;
  --muted: #66736e;
  --sage: #36594d;
  --sage-light: #e2ebe5;
  --cream: #f7f1e7;
  --paper: #fffdf9;
  --line: #dfded7;
  --terracotta: #c6785c;
  --terracotta-dark: #a9563f;
  --danger: #984b42;
  --shadow: 0 1.5rem 4.5rem rgba(41, 51, 44, .18);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #d9e2da;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 253, 249, .75) 0 7rem, transparent 7.1rem),
    radial-gradient(circle at 92% 88%, rgba(198, 120, 92, .14) 0 12rem, transparent 12.1rem),
    linear-gradient(145deg, #e8eee7, #d7e0d8 58%, #cedbd3);
}

button,
input { font: inherit; }

.page-shell {
  width: min(100%, 33rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  display: grid;
  align-content: center;
  gap: .9rem;
}

.access-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 253, 249, .96);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 1.75rem;
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 6vw, 2.5rem);
}

.access-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: .38rem;
  background: linear-gradient(90deg, var(--terracotta), #d9a36e, var(--sage));
}

.language-switch {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .45rem;
  margin: -.25rem 0 .85rem;
  font-size: .8rem;
}

.language-switch a {
  color: var(--muted);
  text-decoration: none;
  padding: .25rem .15rem;
}

.language-switch a.active { color: var(--sage); font-weight: 750; }
.language-switch a:focus-visible { outline: 3px solid rgba(198, 120, 92, .3); border-radius: .35rem; }

.welcome-mark { margin: .15rem 0 1.65rem; }

.home-mark {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1.1rem;
  display: grid;
  place-items: center;
  color: var(--sage);
  background: var(--sage-light);
  transform: rotate(-2deg);
}

.home-mark svg {
  width: 2.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-mark .heart {
  fill: var(--terracotta);
  stroke: var(--terracotta);
  stroke-width: 1.5;
}

h1 {
  max-width: 10em;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 9vw, 3.15rem);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -.045em;
}

.lede {
  margin: .85rem 0 1.75rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.stack { display: grid; gap: .7rem; }

label {
  font-size: .88rem;
  font-weight: 700;
}

input[type="password"] {
  width: 100%;
  min-height: 3.8rem;
  border: 1.5px solid var(--line);
  border-radius: 1rem;
  background: white;
  padding: .8rem 1rem;
  font-size: 1.3rem;
  letter-spacing: .16em;
  outline: none;
}

input[type="password"]::placeholder {
  color: #9da49f;
  letter-spacing: 0;
}

input[type="password"]:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(54, 89, 77, .12);
}

.button {
  width: 100%;
  min-height: 3.8rem;
  border: 0;
  border-radius: 1rem;
  padding: .85rem 1rem;
  cursor: pointer;
  font-weight: 750;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.button:active { transform: scale(.985); }
.button:focus-visible { outline: 4px solid rgba(198, 120, 92, .3); outline-offset: 2px; }
.button:disabled { cursor: wait; filter: saturate(.65); opacity: .72; }

.primary {
  margin-top: .35rem;
  color: white;
  background: var(--sage);
  box-shadow: 0 .5rem 1.2rem rgba(54, 89, 77, .2);
  font-size: 1rem;
}

.primary:hover { filter: brightness(1.08); }

.button-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.welcome-note {
  margin: -.25rem 0 1.25rem;
  padding: 1rem;
  border-radius: 1rem;
  color: var(--muted);
  background: var(--sage-light);
  font-size: .95rem;
  line-height: 1.5;
}

.message,
.field-error {
  color: var(--danger);
  font-size: .9rem;
  line-height: 1.4;
}

.message {
  padding: .85rem 1rem;
  border-radius: .85rem;
  background: #faeae5;
}

.support,
.safety {
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
  text-align: center;
}

.privacy-note {
  margin: 0;
  color: rgba(36, 51, 45, .63);
  font-size: .73rem;
  text-align: center;
}

.status-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: fit-content;
  margin: -.25rem 0 1.25rem;
  padding: .55rem .8rem;
  border-radius: 999px;
  color: var(--muted);
  background: var(--sage-light);
  font-size: .87rem;
}

.status-row strong { color: var(--sage); }

.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #65927d;
  box-shadow: 0 0 0 3px rgba(101, 146, 125, .14);
}

.action-grid { display: grid; gap: .8rem; }

.location-message,
.location-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
  text-align: center;
}

.location-message {
  padding: .75rem .9rem;
  border-radius: .85rem;
  background: var(--sage-light);
}

.location-message.error {
  color: var(--danger);
  background: #faeae5;
}

.location-note + .safety { margin-top: .65rem; }

.arrive,
.depart {
  min-height: 5.4rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .9rem;
  text-align: left;
}

.arrive {
  color: white;
  background: var(--sage);
  box-shadow: 0 .55rem 1.25rem rgba(54, 89, 77, .18);
}

.depart {
  color: var(--ink);
  border: 1px solid #ead5ca;
  background: #fbebe3;
}

.button-icon {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: .8rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, .15);
}

.depart .button-icon { background: rgba(198, 120, 92, .14); color: var(--terracotta-dark); }
.button-copy { display: grid; gap: .12rem; font-size: .86rem; font-weight: 500; }
.button-title { font-family: Georgia, "Times New Roman", serif; font-size: 1.28rem; font-weight: 600; }

.result-symbol {
  width: 4.25rem;
  height: 4.25rem;
  display: grid;
  place-items: center;
  border-radius: 1.35rem;
  margin: 0 0 1.4rem;
  color: white;
  font-size: 2rem;
  font-weight: 800;
  transform: rotate(-3deg);
}

.result-symbol.success { background: var(--sage); }
.result-symbol.failure { background: var(--terracotta-dark); }

.status-detail {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: fit-content;
  margin: 1.4rem 0 0;
  padding: .65rem .85rem;
  border-radius: 999px;
  color: var(--muted);
  background: var(--sage-light);
  font-size: .86rem;
}

@media (min-width: 32rem) {
  .action-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 23rem) {
  .access-card { padding: 1.35rem; border-radius: 1.4rem; }
  h1 { font-size: 2.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
