/* Layout for the ACL tool. Tokens and base components are in tokens.css. */

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 56px var(--gutter) 32px;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}
.masthead .logo {
  flex: none;
}
.masthead .wordmark {
  padding-top: 2px;
  white-space: nowrap;
}
.masthead__divider {
  width: 1px;
  height: 18px;
  background: var(--line-button);
}
.masthead__tool {
  font-size: 15px;
  color: var(--ink-muted);
}
.masthead__user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-body);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.stack--tight {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stack > .pill,
.stack--tight > .pill {
  align-self: flex-start;
}

p {
  margin: 0;
}
.intro {
  font-size: 17px;
  color: var(--ink-body);
}

.page-footer {
  margin-top: auto;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

.h2 {
  margin: 0;
}

.input--large {
  min-height: 48px;
  padding: 0 14px;
  font-size: 17px;
}

.field .help,
.field .error {
  margin: 0;
}

.error--icon {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.5;
}
.error--icon svg {
  flex: none;
  margin-top: 2px;
}
.error a {
  color: inherit;
}

.btn__icon {
  display: flex;
}

.summary__box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.summary__url {
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.publication {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--line-button);
  border-radius: var(--radius);
  cursor: pointer;
}
.choice:has(input:checked) {
  padding: 15px 17px;
  border: 2px solid var(--navy);
  background: #f3f6f9;
}
.choice input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--navy);
}
.choice__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
}
.choice__title .pill {
  padding: 2px 8px;
  font-size: 13px;
}
.choice__description {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-body);
}

.code-input {
  width: 220px;
  min-height: 56px;
  padding: 0 16px;
  font: 500 26px var(--font-mono);
  letter-spacing: 0.3em;
}

.aside {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 15px;
  color: var(--ink-body);
}
.aside__row {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  margin: 0;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cream-soft);
  color: var(--navy);
}
.icon-badge--danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-form {
  display: inline;
}
.link-button--plain {
  align-self: flex-start;
  min-height: var(--tap);
  font-weight: 400;
}

.heading-with-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-badge--small {
  flex: none;
  width: 40px;
  height: 40px;
}
.icon-badge--inline {
  flex: none;
  width: 36px;
  height: 36px;
}
.icon-badge--success {
  background: var(--success-bg);
  color: var(--success);
}
.icon-badge--warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.connection {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px 14px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.connection__summary {
  display: flex;
  align-items: center;
  gap: 14px;
}
.connection__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.connection__title {
  font-size: 16px;
  font-weight: 600;
}
.connection__details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.disclosure {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--navy);
  font: 600 15px var(--font-ui);
  cursor: pointer;
}
.disclosure .chevron {
  transition: transform 150ms;
}
.disclosure[aria-expanded='true'] .chevron {
  transform: rotate(180deg);
}

.addresses {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.addresses__row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}
.addresses dt {
  font-size: 14px;
  color: var(--ink-muted);
}
.addresses dd {
  margin: 0;
  font-size: 15px;
}
.muted {
  color: var(--ink-muted);
}

.custom-row {
  display: flex;
  gap: 8px;
}
.custom-row .input {
  flex: 1;
  min-width: 0;
  font-size: 15px;
}
.custom-row .btn {
  min-height: var(--tap);
  padding: 0 16px;
  font-size: 15px;
}

.detect-failed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.steps {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.step:last-child {
  border-bottom: 0;
}
.step__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--navy);
}
.step--done .step__icon {
  border-radius: 50%;
  background: var(--success);
  color: #fff;
}
.step__dot {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-button);
  border-radius: 50%;
}
.step__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.step__title {
  font-size: 16px;
  font-weight: 600;
}
.step--pending .step__title {
  color: var(--ink-muted);
}
.step__title .mono {
  font-size: 15px;
}

.spinner {
  animation: spin 900ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-soft);
}
.progress__bar {
  width: 0;
  height: 100%;
  background: var(--navy);
  transition: width 300ms;
}

.with-icon {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-body);
}
.with-icon svg {
  flex: none;
  margin-top: 3px;
  color: var(--navy);
}

.site-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 16px 10px 14px;
  border: 1px solid var(--line-button);
  border-left-width: 4px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}
.site-link:hover {
  background: var(--paper);
  color: var(--ink);
}
.site-link__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.site-link__name {
  font-weight: 600;
}
.site-link__url {
  font-size: 14px;
  color: var(--ink-muted);
}

h1:focus {
  outline: none;
}

@media (max-width: 480px) {
  body {
    padding-top: 32px;
    gap: 24px;
  }
  .masthead {
    gap: 10px;
  }
  .masthead .logo {
    width: 28px;
    height: 28px;
  }
  .masthead .wordmark {
    font-size: 20px;
  }
  .masthead__divider {
    height: 16px;
  }
  .masthead__tool {
    font-size: 14px;
  }
  .card.stack {
    gap: 20px;
  }
  .masthead--signed-in .masthead__divider,
  .masthead--signed-in .masthead__tool {
    display: none;
  }
  .masthead__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .disclosure__extra {
    display: none;
  }
  .icon-badge--small {
    width: 36px;
    height: 36px;
  }
  .connection__summary {
    gap: 12px;
  }
  .addresses__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .btn {
    width: 100%;
  }
  .custom-row .btn,
  .actions .btn {
    width: auto;
  }
  .connection {
    padding: 12px 12px 14px;
  }
}
