/* assets/css/visitor-gate.css */

html.mh-gate-locked,
body.mh-gate-locked {
  overflow: hidden !important;
  height: 100%;
}

body.mh-gate-locked {
  touch-action: none;
}

.mh-visitor-gate[aria-hidden="true"] {
  display: none;
}

.mh-visitor-gate {
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.mh-visitor-gate,
.mh-visitor-gate * {
  box-sizing: border-box;
}

.mh-visitor-gate__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.78) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mh-visitor-gate__panel {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.mh-visitor-gate__card {
  width: min(780px, 100%);
  max-height: min(92vh, 920px);
  max-height: min(92dvh, 920px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  box-shadow:
    0 30px 90px rgba(2, 6, 23, 0.30),
    0 8px 24px rgba(15, 23, 42, 0.08);
  overscroll-behavior: contain;
}

.mh-visitor-gate__header {
  padding: 26px 24px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.10), transparent 34%),
    radial-gradient(circle at top left, rgba(17, 155, 210, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.mh-visitor-gate__title {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.mh-visitor-gate__subtitle {
  margin: 0;
  max-width: 62ch;
  color: #475569;
  font-size: 15px;
  line-height: 1.75;
  font-weight: 500;
}

.mh-visitor-gate__form {
  padding: 24px;
}

.mh-visitor-gate__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mh-visitor-gate__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.mh-visitor-gate__field--full {
  margin-top: 16px;
}

.mh-visitor-gate__field label {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 800;
}

.mh-visitor-gate__field input[type="text"],
.mh-visitor-gate__field input[type="email"],
.mh-visitor-gate__field input[type="tel"] {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.4;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background-color 0.18s ease;
}

.mh-visitor-gate__field input:hover,
.mh-multiselect:hover {
  border-color: rgba(15, 23, 42, 0.22);
}

.mh-visitor-gate__field input:focus,
.mh-multiselect__search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.mh-visitor-gate__field input::placeholder,
.mh-multiselect__search::placeholder {
  color: #94a3b8;
}

.mh-visitor-gate__hint {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.6;
}

.mh-multiselect {
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 16px;
  padding: 10px;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.mh-multiselect:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.mh-multiselect__search {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 15px;
  line-height: 1.4;
  outline: none;
  background: #ffffff;
}

.mh-multiselect__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mh-multiselect__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 155, 210, 0.10);
  border: 1px solid rgba(17, 155, 210, 0.20);
  color: #0b4b8c;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

.mh-multiselect__chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mh-multiselect__chip button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  border-radius: 999px;
}

.mh-multiselect__chip button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.mh-multiselect__dropdown {
  margin-top: 10px;
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 8px;
}

.mh-multiselect__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.mh-multiselect__option:hover {
  background: rgba(15, 23, 42, 0.03);
}

.mh-multiselect__option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 2px 0 0;
}

.mh-multiselect__option span {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  word-break: break-word;
}

.mh-visitor-gate__error,
.mh-visitor-gate__success {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 700;
  word-break: break-word;
}

.mh-visitor-gate__error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.mh-visitor-gate__success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.mh-visitor-gate__actions {
  margin-top: 18px;
}

.mh-visitor-gate__submit {
  width: 100%;
  min-height: 54px;
  appearance: none;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b4b8c 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(11, 75, 140, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.mh-visitor-gate__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(11, 75, 140, 0.26);
  filter: saturate(1.04);
}

.mh-visitor-gate__submit:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 3px;
}

.mh-visitor-gate__submit:disabled {
  opacity: 0.75;
  cursor: wait;
  transform: none;
  box-shadow: 0 12px 22px rgba(11, 75, 140, 0.16);
  filter: none;
}

/* Scrollbar polish */
.mh-multiselect__dropdown::-webkit-scrollbar,
.mh-visitor-gate__card::-webkit-scrollbar {
  width: 10px;
}

.mh-multiselect__dropdown::-webkit-scrollbar-track,
.mh-visitor-gate__card::-webkit-scrollbar-track {
  background: transparent;
}

.mh-multiselect__dropdown::-webkit-scrollbar-thumb,
.mh-visitor-gate__card::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

@media (max-width: 768px) {
  .mh-visitor-gate__panel {
    padding: 12px;
  }

  .mh-visitor-gate__card {
    border-radius: 18px;
    max-height: min(94vh, 1000px);
    max-height: min(94dvh, 1000px);
  }

  .mh-visitor-gate__header,
  .mh-visitor-gate__form {
    padding: 16px;
  }

  .mh-visitor-gate__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mh-visitor-gate__title {
    font-size: 24px;
  }

  .mh-visitor-gate__subtitle {
    font-size: 14px;
    line-height: 1.7;
  }

  .mh-multiselect__dropdown {
    max-height: 220px;
  }
}

@media (max-width: 480px) {
  .mh-visitor-gate__panel {
    align-items: start;
    padding: 8px;
  }

  .mh-visitor-gate__card {
    margin-top: 10px;
    width: 100%;
    border-radius: 16px;
    max-height: calc(100dvh - 20px);
  }

  .mh-visitor-gate__header,
  .mh-visitor-gate__form {
    padding: 14px;
  }

  .mh-visitor-gate__title {
    font-size: 22px;
  }

  .mh-visitor-gate__field input[type="text"],
  .mh-visitor-gate__field input[type="email"],
  .mh-visitor-gate__field input[type="tel"] {
    min-height: 50px;
    font-size: 16px;
  }

  .mh-multiselect__search {
    min-height: 46px;
    font-size: 16px;
  }

  .mh-multiselect__chip {
    max-width: 100%;
  }

  .mh-multiselect__chip span {
    max-width: 100%;
  }

  .mh-visitor-gate__submit {
    min-height: 52px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mh-visitor-gate__field input,
  .mh-multiselect,
  .mh-multiselect__option,
  .mh-visitor-gate__submit {
    transition: none;
  }
}