/* Domains module: search results, order form, DNS editor. */

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

.domain-page h1 {
  margin-top: 0.25rem;
}

.domain-search {
  margin: 1.25rem 0;
}

.domain-search input {
  font-size: 1.05rem;
}

/* --- Search results ----------------------------------------------------- */

.domain-results {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.domain-result {
  display: grid;
  grid-template-columns: minmax(0, 2fr) auto minmax(0, 2fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
}

.domain-result:first-child {
  border-top: 0;
}

.domain-result.is-exact {
  background: var(--surface-2);
}

.domain-result.is-free .domain-name {
  font-weight: 700;
}

.domain-result-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}

.domain-name {
  font-size: 1.05rem;
}

.domain-result-action {
  text-align: right;
}

@media (max-width: 640px) {
  .domain-result {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .domain-result-price,
  .domain-result-action {
    grid-column: 1 / -1;
    text-align: left;
  }
}

.domain-empty .empty {
  margin-bottom: 1.5rem;
}

.tld-prices td.mono {
  font-weight: 600;
}

.name-finder .card-head h2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --- Order form --------------------------------------------------------- */

.order-grid {
  align-items: start;
}

.contact-choice,
.contact-new {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.contact-new legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.contact-option {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.contact-option:has(input:checked) {
  border-color: var(--ink);
  background: var(--surface-2);
}

.contact-option input {
  margin-top: 0.2rem;
}

/* Without JS every field stays visible; domains.js hides the unused block. */
.contact-new.is-hidden {
  display: none;
}

.price-summary .check {
  margin-top: 0.75rem;
}

.renew-now {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* --- DNS editor --------------------------------------------------------- */

.dns-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.dns-head,
.dns-form,
.dns-readonly {
  display: grid;
  grid-template-columns: minmax(5rem, 1fr) 4rem minmax(0, 3fr) 6rem 5rem auto;
  gap: 0.5rem;
  align-items: center;
}

.dns-head {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0 0.35rem;
  border-bottom: 1px solid var(--line);
}

.dns-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.dns-row.has-error {
  background: var(--error-bg);
}

.dns-row input {
  width: 100%;
  min-width: 0;
}

.dns-type {
  font-weight: 600;
  font-family: var(--mono);
}

.dns-readonly .dns-content {
  overflow-wrap: anywhere;
}

.dns-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

.dns-row .field-error {
  margin: 0.35rem 0 0;
}

@media (max-width: 760px) {
  .dns-head {
    display: none;
  }

  .dns-form,
  .dns-readonly {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dns-form .dns-content,
  .dns-readonly .dns-content {
    grid-column: 1 / -1;
  }
}

.dns-add .dns-prio-field.is-hidden {
  display: none;
}
