/* pms-config — Hotel Profile, PMS Config tab (Figma 600:17000) */
/* Brand values: only --wa-* tokens (no hard-coded colours) */

.pms-config {
  display: flex;
  flex-direction: column;
  gap: var(--wa-space-l);
}

.pms-config__errors {
  color: var(--wa-color-danger-40);
  font-size: var(--wa-font-size-s);
  list-style: none;
  padding: 0;
  margin: 0;
}

.pms-config__card {
  background: var(--wa-color-surface-default);
  border: 1px solid var(--wa-color-surface-border);
  border-radius: var(--wa-border-radius-l);
  padding: var(--wa-space-l);
  display: flex;
  flex-direction: column;
  gap: var(--wa-space-m);
}

/* The fieldset holds .pms-config__row rows only — it is NOT itself a grid,
   otherwise the two credential inputs would be placed as stray grid items. */

.pms-config__table {
  width: 100%;
  border-collapse: collapse;
}

.pms-config__table th,
.pms-config__table td {
  text-align: left;
  padding: var(--wa-space-s) var(--wa-space-m);
  border-block-end: 1px solid var(--wa-color-surface-border);
  vertical-align: middle;
}

.pms-config__table th {
  background: var(--wa-color-surface-lowered);
  font-size: var(--wa-font-size-s);
}

.pms-config__code {
  color: var(--wa-color-text-quiet);
  font-size: var(--wa-font-size-s);
  margin-inline-start: var(--wa-space-2xs);
}

.pms-config__empty {
  color: var(--wa-color-text-quiet);
  margin: 0;
}

.pms-config__test {
  align-self: flex-start;
}

/* HMS-1580 — the tier-1 fieldset IS the grid: two columns, one row per
   related pair (PMS Provider/Property Code, Endpoint URL/Protocol, CRS
   username/password), so every field shares the same width and the rows
   align. The API-key field spans both columns — it is the long credential,
   and pairing it with half of the alternative CRS auth pair would imply
   they belong together. The fieldset stays a fieldset so `disabled`
   cascades to its controls; the UA chrome is reset here. */
.pms-config__tier-fields {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--wa-space-m);
  align-items: start;
}

/* Author display:grid beats the UA [hidden] rule — without this the
   pms-tier Stimulus controller's hidden toggle stops hiding the Tier-1
   fields when Tier 2 is picked. */
.pms-config__tier-fields[hidden] {
  display: none;
}

.pms-config__field--full {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .pms-config__tier-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pms-config__test-btn {
  padding: 0.55rem 1rem;
  border: 1px solid var(--wa-color-surface-border);
  border-radius: var(--wa-border-radius-m);
  background: var(--wa-color-surface-default);
  color: var(--wa-color-text-normal);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.pms-config__test-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Right-aligned Save Changes, matching the other profile cards. */
.pms-config__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--wa-space-s);
}


