:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  --canvas: #e9eff5;
  --canvas-deep: #dfe7ef;
  --panel: rgb(250 252 254 / 96%);
  --blue: #2f6fc8;
  --blue-hover: #255da9;
  --blue-soft: #e8f0fb;
  --green: #159447;
  --text: #17283b;
  --muted: #61758a;
  --muted-strong: #41566b;
  --line: rgb(79 111 143 / 17%);
  --line-strong: rgb(67 105 145 / 28%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 52% 38%, rgb(255 255 255 / 88%), transparent 36rem),
    linear-gradient(145deg, var(--canvas), var(--canvas-deep) 78%);
  color: var(--text);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-position: center;
  background-size: 72px 72px;
  content: "";
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  opacity: 0.3;
  pointer-events: none;
}

body::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  border: 1px solid rgb(255 255 255 / 44%);
  box-shadow: inset 0 0 8rem rgb(69 91 114 / 6%);
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
}

.access-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-columns: minmax(0, 1fr);
  padding: max(1.5rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 3rem) max(1.5rem, env(safe-area-inset-bottom));
  justify-content: center;
  place-items: center;
}

.access-panel {
  position: relative;
  width: 100%;
  max-width: 31rem;
  min-width: 0;
  min-height: min(38rem, calc(100svh - 3rem));
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 5vw, 2.65rem);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 0.9rem;
  background: var(--panel);
  box-shadow:
    0 1.5rem 4rem rgb(41 66 92 / 13%),
    0 1px 0 rgb(255 255 255 / 90%) inset;
}

.access-panel::before {
  position: absolute;
  top: 0;
  left: 18%;
  width: 64%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  content: "";
  opacity: 0.9;
}

.access-panel::after {
  position: absolute;
  top: 6.5rem;
  right: -6.5rem;
  width: 14rem;
  height: 14rem;
  border: 1px solid rgb(47 111 200 / 10%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.panel-index {
  position: absolute;
  top: 1.45rem;
  right: 1.55rem;
  color: #8394a5;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo-frame {
  display: grid;
  width: 3.65rem;
  height: 3.65rem;
  padding: 0.18rem;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0.5rem 1.5rem rgb(47 111 200 / 10%);
  place-items: center;
}

.logo-frame img,
.vault-brand img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.company-name {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.access-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(3.25rem, 9vh, 5.25rem) 0 clamp(2.5rem, 7vh, 3.5rem);
}

.system-label {
  margin: 0 0 0.85rem;
  color: var(--blue);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.access-content h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 2.35rem);
  font-weight: 450;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.subtitle {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.03rem);
  line-height: 1.6;
}

.primary-action {
  display: flex;
  width: 100%;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(2.25rem, 6vh, 3.25rem);
  padding: 0.75rem 1.15rem 0.75rem 1.35rem;
  border: 1px solid var(--blue);
  border-radius: 0.45rem;
  background: var(--blue);
  box-shadow:
    0 0.7rem 1.8rem rgb(47 111 200 / 18%),
    inset 0 1px rgb(255 255 255 / 18%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-action:hover {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
  box-shadow:
    0 0.85rem 2rem rgb(47 111 200 / 24%),
    inset 0 1px rgb(255 255 255 / 18%);
  transform: translateY(-1px);
}

.primary-action:active {
  transform: translateY(0);
}

.primary-action:focus-visible,
.vault-brand:focus-visible,
.vault-footer a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.action-arrow {
  display: grid;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;
  background: rgb(255 255 255 / 8%);
  font-size: 1rem;
  place-items: center;
}

.access-note,
.route-state {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  margin: 1.15rem 0 0;
  color: #718497;
  font-size: 0.72rem;
  letter-spacing: 0.015em;
}

.status-dot {
  width: 0.42rem;
  height: 0.42rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgb(21 148 71 / 10%);
}

.panel-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  color: #718497;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.footer-divider {
  width: 1.5rem;
  height: 1px;
  background: var(--line-strong);
}

/* Vault shell */
.vault-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.vault-header,
.vault-footer {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 4vw, 3.5rem);
}

.vault-header {
  border-bottom: 1px solid var(--line);
  background: rgb(247 250 252 / 70%);
}

.vault-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.4rem;
  text-decoration: none;
}

.vault-brand img {
  width: 2.35rem;
  height: 2.35rem;
  padding: 0.1rem;
  background: #fff;
}

.vault-brand span {
  display: grid;
  gap: 0.08rem;
}

.vault-brand strong {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.vault-brand small {
  color: var(--muted);
  font-size: 0.65rem;
}

.route-state {
  margin: 0;
  letter-spacing: 0.04em;
}

.vault-main {
  position: relative;
  z-index: 1;
  display: grid;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 6vw, 6rem);
  place-items: center;
}

.vault-shell {
  width: min(100%, 58rem);
  padding: clamp(2rem, 6vw, 4.5rem);
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--panel);
  box-shadow: 0 1.5rem 4.5rem rgb(41 66 92 / 12%);
}

.vault-shell h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 450;
  letter-spacing: -0.04em;
  line-height: 1.06;
}

.vault-intro {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.vault-boundary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(4rem, 10vw, 8rem);
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.boundary-state {
  color: var(--green);
}

.vault-footer {
  border-top: 1px solid var(--line);
  background: rgb(247 250 252 / 70%);
  color: #718497;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.vault-footer a {
  border-radius: 0.25rem;
  color: var(--muted-strong);
  text-underline-offset: 0.25rem;
}

@media (max-width: 600px) {
  body::before {
    background-size: 48px 48px;
  }

  .access-shell {
    padding-inline: 0.8rem;
  }

  .access-panel {
    min-height: calc(100svh - 1.6rem);
    border-radius: 0.9rem;
  }

  .panel-index {
    display: none;
  }

  .access-content h1 {
    font-size: clamp(1.8rem, 7.5vw, 2.1rem);
  }

  .vault-header,
  .vault-footer {
    padding-inline: 1rem;
  }

  .route-state {
    font-size: 0;
  }

  .route-state .status-dot {
    width: 0.48rem;
    height: 0.48rem;
  }

  .vault-main {
    padding: 1rem;
  }

  .vault-shell {
    min-height: 62vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .vault-boundary {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 4rem;
  }
}

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