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

.access-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
}

.access-dialog::backdrop {
  background: rgba(3, 7, 12, 0.78);
  -webkit-backdrop-filter: blur(10px) saturate(80%);
  backdrop-filter: blur(10px) saturate(80%);
}

.access-dialog[open] {
  animation: access-dialog-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.access-card {
  position: relative;
  display: grid;
  gap: 0;
  padding: clamp(28px, 5vw, 42px);
  border: 1px solid rgba(174, 184, 194, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(27, 193, 245, 0.06), transparent 36%, rgba(211, 149, 62, 0.08)),
    rgba(9, 16, 25, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 32px 90px rgba(0, 0, 0, 0.48);
}

.access-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.access-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-strong);
}

.access-lock-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  border: 1px solid rgba(211, 149, 62, 0.3);
  border-radius: 12px;
  color: var(--brand-gold-light);
  background: rgba(211, 149, 62, 0.08);
}

.access-lock-mark svg {
  width: 22px;
  height: 22px;
}

.access-title {
  padding: 0 24px;
  text-align: center;
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1.12;
}

.access-description {
  margin: 12px 0 24px;
  color: var(--muted);
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.5;
}

.access-input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(174, 184, 194, 0.22);
  border-radius: 10px;
  outline: 0;
  background: rgba(5, 10, 16, 0.62);
  color: var(--text-strong);
  font-family: "Exo 2", "Inter", sans-serif;
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-align: center;
  caret-color: var(--brand-gold-light);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.access-input::placeholder {
  color: rgba(174, 184, 194, 0.5);
  letter-spacing: 0.3em;
}

.access-input:focus {
  border-color: var(--brand-gold);
  background: rgba(8, 14, 22, 0.82);
  box-shadow: 0 0 0 3px rgba(211, 149, 62, 0.12);
}

.access-error {
  min-height: 22px;
  margin: 10px 0 12px;
  color: #ff8c82;
  text-align: center;
  font-size: 0.84rem;
  line-height: 1.45;
}

.access-submit,
.access-cancel {
  min-height: 50px;
  border-radius: 10px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
}

.access-submit {
  border: 1px solid rgba(241, 196, 111, 0.4);
  background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
  color: #111820;
  box-shadow: 0 12px 26px rgba(156, 105, 50, 0.24);
  transition: transform 180ms ease, filter 180ms ease, opacity 180ms ease;
}

.access-submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.access-submit:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
}

.access-cancel {
  min-height: 40px;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  transition: color 180ms ease;
}

.access-cancel:hover {
  color: var(--text-strong);
}

.access-close:focus-visible,
.access-input:focus-visible,
.access-submit:focus-visible,
.access-cancel:focus-visible {
  outline: 2px solid var(--cool);
  outline-offset: 3px;
}

body.access-modal-open {
  overflow: hidden;
}

html[data-theme="light"] .access-dialog::backdrop {
  background: rgba(28, 40, 56, 0.56);
}

html[data-theme="light"] .access-card {
  border-color: rgba(45, 70, 101, 0.18);
  background:
    linear-gradient(145deg, rgba(14, 159, 199, 0.08), transparent 36%, rgba(201, 133, 44, 0.08)),
    rgba(249, 252, 255, 0.98);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 34px 90px rgba(35, 55, 78, 0.28);
}

html[data-theme="light"] .access-input {
  border-color: rgba(45, 70, 101, 0.2);
  background: rgba(238, 244, 250, 0.8);
  color: #142033;
}

html[data-theme="light"] .access-input:focus {
  border-color: #c9852c;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(201, 133, 44, 0.12);
}

html[data-theme="light"] .access-close:hover {
  background: rgba(20, 43, 69, 0.06);
}

@keyframes access-dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .access-card {
    padding: 32px 22px 24px;
  }

  .access-title {
    padding: 0 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .access-dialog[open] {
    animation: none;
  }

  .access-submit,
  .access-close,
  .access-cancel {
    transition: none;
  }
}
