/* Hosting506 — Acceso-style dialogs (.hx-dlg*)
 * Tokens mirror #xnc-pw-modal / acceso-modals.md
 */

.hx-dlg {
  --hx-dlg-accent: #1f5fa8;
  --hx-dlg-navy: #0d2f56;
  --hx-dlg-ink: #111a24;
  --hx-dlg-muted: #68788c;
  --hx-dlg-muted-2: #8d9aab;
  --hx-dlg-line: #e6ebf1;
  --hx-dlg-border: #dbe2ea;
  --hx-dlg-soft: #f5f7fa;
  --hx-dlg-icon-bg: #e8f1fb;
  --hx-dlg-warn-bg: #fff8ed;
  --hx-dlg-warn-border: #f0b45a;
  --hx-dlg-warn-ink: #8a5a12;
  --hx-dlg-radius: 18px;
  --hx-dlg-radius-sm: 10px;
  --hx-dlg-shadow: 0 20px 56px rgba(16, 26, 40, 0.22);
  font-family: Roboto, system-ui, -apple-system, sans-serif;
  color: var(--hx-dlg-ink);
}

/* Bootstrap shell */
.modal.hx-dlg .modal-dialog {
  width: auto;
  max-width: 480px;
  margin: 30px auto;
}
.modal.hx-dlg.hx-dlg--lg .modal-dialog {
  max-width: 680px;
}
.modal.hx-dlg .modal-content,
.hx-dlg.xnpin-modal-card,
.xnpin-modal-card.hx-dlg {
  border: 0;
  border-radius: var(--hx-dlg-radius);
  box-shadow: var(--hx-dlg-shadow);
  background: #fff;
  overflow: hidden;
  color: var(--hx-dlg-ink);
}
.modal.hx-dlg .modal-content.hx-dlg__dialog {
  padding: 0;
}

.hx-dlg__dialog {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: var(--hx-dlg-radius);
  box-shadow: var(--hx-dlg-shadow);
  padding: 22px 24px 20px;
}
.hx-dlg--lg .hx-dlg__dialog,
.modal.hx-dlg.hx-dlg--lg .modal-content {
  max-width: 680px;
}

/* When Bootstrap modal-content is the dialog surface */
.modal.hx-dlg .modal-content {
  padding: 22px 24px 0;
}
.modal.hx-dlg .modal-body {
  padding: 0 0 8px;
}
.modal.hx-dlg .modal-header,
.modal.hx-dlg .modal-footer {
  display: none; /* prefer .hx-dlg__head / __foot */
}

/* Kill Hexa/global label uppercase inside dialogs */
.hx-dlg label,
.hx-dlg .hx-dlg__label,
.hx-dlg .hx-dlg__chip,
.hx-dlg .hx-dlg__summary-label,
.modal.hx-dlg label {
  text-transform: none !important;
  letter-spacing: normal !important;
}
.hx-dlg .hx-dlg__label,
.hx-dlg .hx-dlg__title {
  letter-spacing: -0.01em !important;
}

/* Head */
.hx-dlg__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.hx-dlg__icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--hx-dlg-icon-bg);
  color: var(--hx-dlg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-top: 0;
}
.hx-dlg__icon .fa,
.hx-dlg__icon i {
  line-height: 1;
  margin: 0;
}
.hx-dlg__titles {
  flex: 1;
  min-width: 0;
  padding-top: 0;
  margin: 0;
}
.hx-dlg__title,
.hx-dlg h4.hx-dlg__title,
.hx-dlg.modal .modal-content .hx-dlg__title {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--hx-dlg-ink);
  line-height: 1.25;
}
.hx-dlg__sub {
  margin: 5px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--hx-dlg-muted);
  text-wrap: pretty;
}
.hx-dlg__x {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: 0;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--hx-dlg-muted-2);
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  padding: 0;
  align-self: flex-start;
}
.hx-dlg__x:hover {
  background: #f4f6f9;
  color: #2c3d52;
}

/* Notice */
.hx-dlg__notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid var(--hx-dlg-line);
  border-left: 3px solid var(--hx-dlg-accent);
  border-radius: var(--hx-dlg-radius-sm);
  background: var(--hx-dlg-soft);
  color: var(--hx-dlg-muted);
  font-size: 13px;
  line-height: 1.4;
}
.hx-dlg__notice--warn {
  background: var(--hx-dlg-warn-bg);
  border-color: #f5dfb3;
  border-left-color: var(--hx-dlg-warn-border);
  color: var(--hx-dlg-warn-ink);
}
.hx-dlg__notice i,
.hx-dlg__notice .fa {
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 15px;
}
.hx-dlg__notice strong {
  font-weight: 600;
  margin-right: 0.35em;
}

/* Body / form */
.hx-dlg__body {
  min-width: 0;
}
.hx-dlg__form .hx-dlg__field {
  margin-bottom: 14px;
}
.hx-dlg__field:last-child {
  margin-bottom: 0;
}
.hx-dlg__label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #3d4f66;
}
.hx-dlg__label .hx-req {
  color: #c0392b;
  text-transform: none;
  letter-spacing: 0;
}
.hx-dlg__control {
  position: relative;
}
.hx-dlg__control .hx-dlg__field-icon,
.hx-dlg__control > .fa,
.hx-dlg__control > i.fa {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hx-dlg-muted-2);
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}
.hx-dlg__control--textarea > .fa,
.hx-dlg__control--textarea > i.fa {
  top: 14px;
  transform: none;
}
.hx-dlg__input,
.hx-dlg input.hx-dlg__input,
.hx-dlg textarea.hx-dlg__input,
.hx-dlg .form-control.hx-dlg__input {
  display: block;
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--hx-dlg-border);
  border-radius: var(--hx-dlg-radius-sm);
  background: #fff;
  color: var(--hx-dlg-ink);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hx-dlg__control:has(.hx-dlg__field-icon) .hx-dlg__input,
.hx-dlg__control:has(> .fa) .hx-dlg__input,
.hx-dlg__control:has(> i.fa) .hx-dlg__input {
  padding-left: 38px;
}
.hx-dlg textarea.hx-dlg__input {
  height: auto;
  min-height: 96px;
  resize: vertical;
  padding-top: 10px;
}
.hx-dlg__input:focus,
.hx-dlg .form-control.hx-dlg__input:focus {
  border-color: #2d84de;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.12);
}
.hx-dlg__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
@media (max-width: 560px) {
  .hx-dlg__grid {
    grid-template-columns: 1fr;
  }
}

/* Chips */
.hx-dlg__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.hx-dlg__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--hx-dlg-border);
  border-radius: 999px;
  background: #fff;
  color: #2c3d52;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.hx-dlg__chip:hover {
  border-color: #b8c4d2;
  background: #f8fafc;
}
.hx-dlg__chip.is-on,
.hx-dlg__chip:has(input:checked) {
  background: var(--hx-dlg-accent);
  border-color: var(--hx-dlg-accent);
  color: #fff;
}
.hx-dlg__chip-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.hx-dlg__chip {
  position: relative;
}

/* Soft panel / steps */
.hx-dlg__panel {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--hx-dlg-soft);
  border-radius: 14px;
}
.hx-dlg__panel-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--hx-dlg-ink);
}
.hx-dlg__steps {
  margin: 0;
  padding: 0 0 0 1.25em;
  list-style: decimal;
  font-size: 13px;
  line-height: 1.5;
  color: #3d4f66;
}
.hx-dlg__steps li {
  margin: 0 0 6px;
}
.hx-dlg__steps li:last-child {
  margin-bottom: 0;
}
.hx-dlg__tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--hx-dlg-line);
  font-size: 12.5px;
  color: var(--hx-dlg-muted);
  line-height: 1.4;
}

/* Summary card (titular) */
.hx-dlg__summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--hx-dlg-soft);
  border-radius: 14px;
}
.hx-dlg__summary-label {
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--hx-dlg-muted-2);
}
.hx-dlg__summary-label--new {
  color: var(--hx-dlg-accent);
}
.hx-dlg__summary-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--hx-dlg-ink);
}
.hx-dlg__summary-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--hx-dlg-muted);
  line-height: 1.35;
}
.hx-dlg__summary-arrow {
  color: var(--hx-dlg-muted-2);
  font-size: 16px;
}
@media (max-width: 560px) {
  .hx-dlg__summary {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .hx-dlg__summary-arrow {
    display: none;
  }
}

/* Foot */
.hx-dlg__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--hx-dlg-line);
}
.modal.hx-dlg .hx-dlg__foot {
  margin-left: -24px;
  margin-right: -24px;
  margin-bottom: 0;
  padding: 14px 24px 18px;
  background: #fafbfc;
}
.hx-dlg__cancel {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--hx-dlg-muted);
  padding: 8px 4px;
}
.hx-dlg__cancel:hover {
  color: #2c3d52;
}
.hx-dlg__hint {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  color: var(--hx-dlg-muted-2);
  line-height: 1.35;
  min-width: 0;
}
.hx-dlg__cta,
.hx-dlg button.hx-dlg__cta {
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  height: 44px;
  padding: 0 18px;
  background: var(--hx-dlg-navy);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(13, 47, 86, 0.22);
  white-space: nowrap;
}
.hx-dlg__cta:hover,
.hx-dlg__cta:focus {
  background: #0a2340;
  color: #fff !important;
}
.hx-dlg__cta:disabled,
.hx-dlg__cta[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  background: #9aa8b8;
}
.hx-dlg__cta .fa,
.hx-dlg__cancel .fa {
  font-size: 13px;
}

.hx-dlg__hint-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--hx-dlg-muted);
  line-height: 1.4;
}
.hx-dlg__terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 13px;
  color: #3d4f66;
  line-height: 1.4;
}
.hx-dlg__terms input {
  margin-top: 3px;
}

/* Soft cfg box (mode pick etc.) */
.hx-dlg__cfg {
  background: var(--hx-dlg-soft);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* Dark */
html.dark .hx-dlg,
html.dark .modal.hx-dlg .modal-content,
html.dark .hx-dlg.xnpin-modal-card,
html.dark .xnpin-modal-card.hx-dlg,
html.dark .hx-dlg__dialog {
  --hx-dlg-ink: #e8edf4;
  --hx-dlg-muted: #9aa8b8;
  --hx-dlg-muted-2: #7a8799;
  --hx-dlg-line: rgba(255, 255, 255, 0.07);
  --hx-dlg-border: #3a4454;
  --hx-dlg-soft: #161b24;
  --hx-dlg-icon-bg: #243044;
  --hx-dlg-warn-bg: #2a2418;
  --hx-dlg-warn-ink: #e8c48a;
  --hx-dlg-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  color: var(--hx-dlg-ink);
  background: #1c212b !important;
}
html.dark .hx-dlg__input,
html.dark .hx-dlg .form-control.hx-dlg__input {
  background: #12161e !important;
  color: var(--hx-dlg-ink);
  border-color: var(--hx-dlg-border);
}
html.dark .hx-dlg__chip {
  background: #12161e;
  color: #c5ced8;
  border-color: var(--hx-dlg-border);
}
html.dark .hx-dlg__chip.is-on,
html.dark .hx-dlg__chip:has(input:checked) {
  background: var(--hx-dlg-accent);
  border-color: var(--hx-dlg-accent);
  color: #fff;
}
html.dark .hx-dlg__x:hover {
  background: #243044;
  color: #e8edf4;
}
/* Foot = same surface as card (avoids dark “cut stripe” at bottom radius) */
html.dark .hx-dlg__foot,
html.dark .modal.hx-dlg .hx-dlg__foot,
html.dark .xnpin-modal-card.hx-dlg .hx-dlg__foot {
  background: #1c212b !important;
  border-top-color: var(--hx-dlg-line);
}
html.dark .hx-dlg__label {
  color: #c5ced8;
}
html.dark .hx-dlg__cancel:hover {
  color: #e8edf4;
}
html.dark .hx-dlg__hint {
  color: #9aa8b8;
}
html.dark .hx-dlg__terms {
  color: #9aa8b8;
}
html.dark .hx-dlg__steps {
  color: #c5ced8;
}
html.dark .hx-dlg__sub {
  color: #9aa8b8;
}

@media (max-width: 480px) {
  .modal.hx-dlg .modal-content {
    padding: 18px 16px 0;
  }
  .modal.hx-dlg .hx-dlg__foot {
    margin-left: -16px;
    margin-right: -16px;
    padding: 12px 16px 16px;
    flex-wrap: wrap;
  }
  .hx-dlg__hint {
    order: 3;
    flex: 1 1 100%;
    text-align: left;
  }
  .hx-dlg__cta {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-dlg__input,
  .hx-dlg__chip,
  .hx-dlg__cta {
    transition: none;
  }
}
