/* Service pages: privacy policy and account deletion. One 720px column on the shared tokens of
   base.css. Sections: 1. Column and headings, 2. Text and lists, 3. Policy page (numbered headings,
   tables, cards, check list), 4. Deletion page (steps, cards, sections), 5. Deletion page: head,
   notice, facts, links, 6. Deletion flow (the dialog of the page without the app). */

/* ==========================================================================
   1. Column and headings
   ========================================================================== */

.legal {
  width: 100%;
  max-width: var(--column-max);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 80px) var(--gutter) clamp(64px, 8vw, 96px);
}

.legal__title {
  margin-bottom: 14px;
  font-size: clamp(32px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}

.legal__title--spaced {
  margin-bottom: 40px;
}

.legal__section {
  margin-bottom: 48px;
}

.legal__section:last-child {
  margin-bottom: 0;
}

.legal__heading {
  margin-bottom: 20px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.4px;
}

/* ==========================================================================
   2. Text and lists
   ========================================================================== */

.legal__text,
.legal__list {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-text);
}

.legal__list {
  padding-left: 22px;
}

.legal__section > :last-child {
  margin-bottom: 0;
}

.legal__link {
  border-radius: 4px;
  color: var(--color-accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   3. Policy page
   Numbered headings, clauses, tables, the cards of section 3, the check list of 6.2. A table wrapper
   scrolls sideways if a word does not fit; on a narrow screen every table is laid out as stacked
   rows (the row header above its cells) instead.
   ========================================================================== */

.legal__heading--num {
  display: flex;
  align-items: center;
  gap: 14px;
}

.legal__num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--color-on-accent);
  background: var(--color-accent);
}

.legal__clause {
  font-weight: 700;
  color: var(--color-muted);
}

.legal-pill__num {
  margin-right: 6px;
  font-weight: 700;
  color: var(--color-muted);
}

.legal__table {
  margin: 0 0 24px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 16px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.legal-table th,
.legal-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.legal-table thead tr {
  background: var(--color-surface-1);
}

.legal-table thead th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--color-muted);
}

.legal-table tbody th {
  width: 34%;
  font-weight: 800;
  color: var(--color-text);
}

.legal-table td {
  color: var(--color-text);
}

.legal-table tbody tr:last-child th,
.legal-table tbody tr:last-child td {
  border-bottom: 0;
}

.legal-table__strong {
  font-weight: 800;
}

.legal-aside {
  margin: 0 0 18px;
  padding: 20px 24px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.7;
  background: var(--color-surface-1);
}

.legal-spec {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 16px;
}

.legal-spec__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  background: var(--color-surface-1);
}

.legal-spec__num {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--color-on-accent);
  background: var(--color-accent);
}

.legal-spec__list {
  margin: 0;
}

.legal-spec__row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
}

.legal-spec__term {
  flex: 0 0 110px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--color-muted);
}

.legal-spec__text {
  flex: 1 1 240px;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.legal-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.legal-checks li {
  position: relative;
  padding: 14px 16px 14px 46px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  background: var(--color-surface-1);
}

.legal-checks li::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 16px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
}

.legal-checks li::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 23px;
  width: 5px;
  height: 9px;
  border: solid var(--color-on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@media (max-width: 640px) {
  .legal-checks {
    grid-template-columns: 1fr;
  }

  .legal-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .legal-table,
  .legal-table tbody,
  .legal-table tr,
  .legal-table th,
  .legal-table td {
    display: block;
  }

  .legal-table tbody th {
    width: auto;
    padding: 14px 16px 4px;
    border-bottom: 0;
  }

  .legal-table td {
    padding: 2px 16px;
    border-bottom: 0;
  }

  .legal-table td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--color-muted);
  }

  .legal-table tbody tr {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
  }

  .legal-table tbody tr:last-child {
    border-bottom: 0;
  }
}

/* ==========================================================================
   4. Deletion page
   ========================================================================== */

.legal-card {
  margin-bottom: 40px;
  padding: 28px 30px;
  border-radius: 20px;
  background: var(--color-surface-1);
}

.legal-card .legal__text {
  margin: 0;
  line-height: 1.7;
}

.legal-card .legal__text + .legal__text {
  margin-top: 8px;
}

.legal__text--spaced {
  margin-bottom: 40px;
}

.legal__section--deletion {
  margin-bottom: 40px;
}

.legal__section--divided {
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.legal__heading--small {
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.legal-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  counter-reset: legal-step;
}

.legal-steps__item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  counter-increment: legal-step;
}

.legal-steps__item::before {
  content: counter(legal-step);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  color: var(--color-on-accent);
  background: var(--color-accent);
}

.legal-steps__text {
  min-width: 0;
  padding-top: 3px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

/* ==========================================================================
   5. Deletion page: head, notice, facts, links
   ========================================================================== */

.legal__lead {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-muted);
}

.legal__meta {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-muted-light);
}

.legal__meta--edition {
  margin: 28px 0 0;
}

.legal__small {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-muted);
}

.legal__subheading {
  margin: 28px 0 10px;
  font-size: 17px;
  font-weight: 800;
}

.legal__text--tight {
  margin-bottom: 8px;
}

.legal__strong-link {
  font-weight: 800;
  text-decoration: none;
  color: var(--color-text);
}

.legal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 32px;
}

.legal-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface-2);
}

.legal-pill:hover {
  color: var(--color-accent-text);
}

.legal-notice {
  margin-bottom: 48px;
  padding: 26px 30px;
  border-radius: 20px;
  background: var(--color-accent-soft);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.legal-notice__title {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 800;
}

.legal-notice .legal__list {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.65;
}

.legal-notice .legal__list li + li {
  margin-top: 8px;
}

.legal__section--deletion .legal__list li::marker {
  color: var(--color-accent);
}

.legal-card--steps .legal-steps {
  margin-bottom: 24px;
}

.legal-card--steps .legal-steps__text {
  font-weight: 500;
  font-size: 16px;
}

.legal-facts {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 20px;
}

.legal-facts__row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 18px 24px;
  border-top: 1px solid var(--color-border);
}

.legal-facts__row:first-child {
  border-top: 0;
  background: var(--color-surface-1);
}

.legal-facts__term {
  flex: 0 0 150px;
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.legal-facts__text {
  flex: 1 1 240px;
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

/* ==========================================================================
   6. Deletion flow
   A modal dialog opened by the button of the section "no access to the app": number, code,
   confirmation, result. The steps and messages are switched with [hidden] by delete-account.js.
   ========================================================================== */

/* Without the script, or in a frame, the button stays hidden and its note is shown; with the
   script loaded the note is hidden until the script says it is needed. */
.js [data-del-blocked] {
  display: none;
}

.js [data-del-blocked].is-shown,
.js-failed [data-del-blocked] {
  display: block;
}

.btn--solid {
  color: var(--color-bg);
  background: var(--color-text);
}

.btn--quiet {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.delete-flow {
  position: fixed;
  inset: 0;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 36px 28px 28px;
  overflow-y: auto;
  border: 0;
  border-radius: 24px;
  color: var(--color-text);
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
}

.delete-flow::backdrop {
  background: rgba(23, 23, 23, .55);
}

.delete-flow .btn {
  width: 100%;
  white-space: normal;
  text-align: center;
}

.delete-flow__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--color-text);
  background: var(--color-surface-1);
  cursor: pointer;
}

.delete-flow__close:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.delete-flow__title {
  margin-bottom: 14px;
  padding-right: 44px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.2;
}

.delete-flow__text {
  display: block;
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-muted);
}

.delete-flow__text strong {
  color: var(--color-text);
}

.delete-flow__input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 1.5px solid var(--color-muted-light);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface-1);
}

.delete-flow__input::placeholder {
  font-weight: 500;
  color: var(--color-muted);
}

.delete-flow__input--code {
  font-size: 26px;
  letter-spacing: 10px;
  text-align: center;
}

.delete-flow__hint {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-muted);
}

.delete-flow__list {
  margin: 0 0 8px;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.55;
}

.delete-flow__list li + li {
  margin-top: 12px;
}

.delete-flow__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.delete-flow__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
}

.delete-flow__link {
  padding: 8px 0;
  border: 0;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--color-accent-text);
  background: none;
  cursor: pointer;
}

.delete-flow__link:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.delete-flow__messages {
  margin-top: 18px;
}

.delete-flow__message {
  margin: 0;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  background: var(--color-accent-soft);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}
