/* docs.houfy.com/access.html, "Get API access": the page's own parts, inside the shared docs frame (css/docs-theme.css:
   fonts, header, left menu, .hf-main, footer). Calm Houfy style: Inter, navy #1F4E66, pink for the main action.
   Everything here is scoped to the page's content and its dialog, so the shared header and menu look as on every page. */

:root {
  --ink: #111827;
  --body: #4b5563;
  --muted: #6b7280;
  --line: #e8eaed;
  --field: #d1d5db;
  --soft: #f7f8fa;
  --navy: #1f4e66;
  --navy-dark: #163a4f;
  --pink: #d5225b;
  --pink-dark: #b81c4d;
  --radius: 10px;
}

[hidden] {
  display: none !important;
}
.access,
.dialog {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}
/* :where() keeps links at the lowest weight, so a link styled as a button (.btn--pink) keeps its own colours */
:where(.access, .dialog) a {
  color: var(--navy);
}
:where(.access, .dialog) a:hover {
  color: var(--navy-dark);
}
.access :focus-visible,
.dialog :focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* ---- the page: one reading column next to the menu, like the Get started guide ---- */
.access {
  max-width: 860px;
  padding: 40px 44px 72px;
}
.crumbs {
  display: flex;
  gap: 8px;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 20px;
}
.access .crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.access .crumbs a:hover {
  text-decoration: underline;
}
.access__grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.access__intro {
  max-width: 720px;
}
.access__intro h1 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
}
.access__intro p {
  margin: 0 0 12px;
  color: var(--body);
  line-height: 24px;
}
.access__how {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.access__panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.block p {
  margin: 0 0 16px;
  color: var(--body);
}
.note {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--body);
}
.alert {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid #f5c2c7;
  background: #fff5f6;
  color: #8a1c2b;
}
.alert--ok {
  border-color: #b7e4c7;
  background: #f0fbf4;
  color: #14532d;
}
.alert--ok:focus {
  outline: none;
}

/* ---- buttons ---- */
.btn {
  height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn--pink {
  background: var(--pink);
  color: #fff;
}
.btn--pink:hover {
  background: var(--pink-dark);
  color: #fff;
}
.btn--pink:disabled {
  background: #f0b7c9;
  cursor: not-allowed;
}
.btn--outline {
  background: #fff;
  color: var(--navy);
  border-color: var(--navy);
}
.btn--outline:hover {
  background: #f3f7f9;
}
.btn--outline:disabled {
  opacity: 0.6;
  cursor: progress;
}
.btn--small {
  height: 38px;
  padding: 0 14px;
  font-size: 15px;
}
.btn--link {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- your applications ---- */
.apps h2,
.apply__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}
.apps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.app {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.app__main {
  min-width: 0;
}
.app__company {
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.app__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
}
.badge--pending {
  background: #fef3c7;
  color: #854d0e;
}
.badge--approved {
  background: #dcfce7;
  color: #166534;
}
.badge--rejected,
.badge--other {
  background: #f3f4f6;
  color: #374151;
}
.app__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}
.app__note {
  font-size: 15px;
  color: var(--muted);
}
.app__key {
  flex-basis: 100%;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--soft);
}
.app__key-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.app__key-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.app__key-value {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: #fff;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
  user-select: all;
}
.app__copied {
  display: block;
  min-height: 20px;
  margin-top: 6px;
  font-size: 14px;
  color: #166534;
}
.app__key-help {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--body);
}
.app__key-help + .app__secret {
  margin-top: 18px;
}

/* ---- the form ---- */
.apply {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.apply__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}
.field--wide {
  grid-column: 1 / -1;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 44px;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
}
.field textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--navy);
  outline-offset: 0;
  border-color: var(--navy);
}

.agreement {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.agreement__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.agreement__intro,
.agreement__links {
  margin: 0;
  font-size: 15px;
  color: var(--body);
}
.agreement__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.terms {
  height: 300px;
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  background: var(--soft);
  font-size: 15px;
  line-height: 1.6;
  color: #1f2937;
  overflow-wrap: anywhere;
}
.terms--tall {
  height: auto;
  max-height: 50vh;
}
.terms > :first-child {
  margin-top: 0;
}
.terms h3,
.terms h4,
.terms h5,
.terms h6 {
  margin: 18px 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.terms p,
.terms ul,
.terms ol {
  margin: 0 0 10px;
}
.terms table {
  border-collapse: collapse;
  margin: 0 0 10px;
}
.terms td,
.terms th {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  color: #374151;
  cursor: pointer;
}
.check input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--navy);
}
.apply__send {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}
.apply__hint {
  font-size: 14px;
  color: var(--muted);
}

/* ---- the signed agreement dialog ---- */
.dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.25);
  color: var(--ink);
}
.dialog[open] {
  display: flex;
  flex-direction: column;
}
.dialog::backdrop {
  background: rgba(17, 24, 39, 0.45);
}
.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.dialog__head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.dialog__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--body);
  cursor: pointer;
}
.dialog__close:hover {
  background: var(--soft);
}
.dialog__body {
  padding: 16px 20px;
  overflow: auto;
}
.dialog__subtitle {
  margin: 18px 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.dialog__foot {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}
.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
  font-size: 15px;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.facts__mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* ---- narrow screens (the menu is a drawer from 900 px down) ---- */
@media (max-width: 900px) {
  .access {
    padding: 24px 16px 56px;
  }
}
@media (max-width: 600px) {
  .access__intro h1 {
    font-size: 28px;
  }
  .apply__fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .app__key-row {
    flex-direction: column;
    align-items: stretch;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .facts dd {
    margin-bottom: 8px;
  }
  .terms {
    height: 260px;
  }
}
