/* /account/deletion/ (redesign 2026 "Open Air", package W3, screen W-13).
 *
 * The page sits on the shared base (/assets/tokens.css, fonts.css and base.css; BASE.md): this file
 * only lays out the deletion flow as a column of auth-style cards (Figma Web/Auth card 31:628) with
 * banners (Banner 30:526) and a danger-zone confirmation (Card/Danger zone 38:770).
 * - Every colour, size and radius is a token, so Day, Dusk and right to left need no rules here.
 * - page.js only writes text, toggles `hidden` and sets the class of #message ("error" or ""; the
 *   first message also removes the initial "checking"). The states below are read from those. */

.deletion {
  padding-block: var(--space-16) var(--space-56);
}

@media (min-width: 600px) {
  .deletion { padding-block: var(--space-56) var(--space-96); }
}

.deletion__column {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  max-width: 640px;
  margin-inline: auto;
  /* Long names, addresses and server hosts wrap instead of widening the page. */
  overflow-wrap: anywhere;
}

.deletion__column p { text-wrap: pretty; }

/* ---------- Cards: the auth card's surface, outline, 32 px corners and padding ---------- */

.deletion-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  padding: var(--space-24);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--elevation-1);
}

@media (min-width: 600px) {
  .deletion-card { padding: var(--space-40); }
}

.deletion-card__lede {
  color: var(--color-text-2);
}

/* The product name stays on one line in the title. */
.deletion-brand { white-space: nowrap; }

.deletion-card__title {
  font-size: var(--type-app-title-l-size);
  line-height: var(--type-app-title-l-line);
  font-weight: var(--type-app-title-l-weight);
  letter-spacing: var(--type-app-title-l-tracking);
}

/* ---------- Status card (#message): info, checking or error; colour, icon and words ---------- */

.deletion-status {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background-color: var(--color-info-container);
  color: var(--color-on-info-container);
}

.deletion-status__icon { margin-block-start: 1px; }

.deletion-status__icon--checking,
.deletion-status__icon--error { display: none; }

.deletion-status:has(#message.checking) .deletion-status__icon--info,
.deletion-status:has(#message.error) .deletion-status__icon--info { display: none; }

.deletion-status:has(#message.checking) .deletion-status__icon--checking,
.deletion-status:has(#message.error) .deletion-status__icon--error { display: inline-block; }

.deletion-status:has(#message.error) {
  background-color: var(--color-error-container);
  color: var(--color-on-error-container);
}

#message {
  flex: 1;
  min-width: 0;
  font-size: var(--type-app-body-l-size);
  line-height: var(--type-app-body-l-line);
  text-wrap: pretty;
}

/* Without :has() the error words still read as an error. */
#message.error { color: var(--color-on-error-container); }

/* The two ways forward, which the deck pairs with the signed-out message. They wait while the page is
 * still checking (it can't tell yet who is signed in), and they give way to the review and the
 * confirmation, whose own buttons are then the page's main action (one main action per state). */
.deletion-paths {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* 16 px sides keep "Sign in to delete your account" on one line at 390 px. */
.deletion-paths .button { padding-inline: var(--space-16); }

.deletion__column:has(#message.checking) .deletion-paths,
.deletion__column:has(#review-section:not([hidden])) .deletion-paths,
.deletion__column:has(#confirmation:not([hidden])) .deletion-paths { display: none; }

/* Signing in leads nowhere after an error, or once page.js has shown an account (#account-name is
 * filled, so this browser is signed in): only the privacy team stays as the way forward. The same
 * goes for #message[data-no-sign-in], if page.js marks the "not available on this deployment" and
 * "already has a saved deletion request" states with it; without that attribute the rule is idle. */
.deletion__column:has(#message.error) .deletion-paths__sign-in,
.deletion__column:has(#account-name:not(:empty)) .deletion-paths__sign-in,
.deletion__column:has(#message[data-no-sign-in]) .deletion-paths__sign-in { display: none; }

/* ---------- Banners: the review's "kept" note and the device note ---------- */

.deletion-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background-color: var(--color-info-container);
  color: var(--color-on-info-container);
  font-size: var(--type-app-body-m-size);
  line-height: var(--type-app-body-m-line);
}

.deletion-banner--success {
  background-color: var(--color-success-container);
  color: var(--color-on-success-container);
}

.deletion-banner__icon { margin-block-start: -1px; }

/* ---------- Saved requests (page.js writes article.request: title, status, Check progress) ---------- */

.deletion-requests {
  display: flex;
  flex-direction: column;
}

.deletion-requests .request {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-8);
  padding-block: var(--space-16);
  border-block-start: 1px solid var(--color-outline);
}

.deletion-requests .request:first-child { padding-block-start: 0; border-block-start: 0; }
.deletion-requests .request:last-child { padding-block-end: 0; }

.deletion-requests .request strong {
  font-size: var(--type-app-title-m-size);
  line-height: var(--type-app-title-m-line);
  font-weight: var(--type-app-title-m-weight);
}

.deletion-requests .request p {
  color: var(--color-text-2);
  font-size: var(--type-app-body-m-size);
  line-height: var(--type-app-body-m-line);
}

.deletion-requests .request .button { margin-block-start: var(--space-4); }

/* ---------- Review: the account, what is removed, then confirming it's you ---------- */

.deletion-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.deletion-account {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.deletion-account .icon { color: var(--color-text-2); }

#account-name {
  min-width: 0;
  font-size: var(--type-app-title-m-size);
  line-height: var(--type-app-title-m-line);
  font-weight: var(--type-app-title-m-weight);
}

/* With the element name this outranks the base's list reset (ul[class]), so the bullets show. */
ul.deletion-impact {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-inline-start: var(--space-24);
  list-style: disc;
}

.deletion-impact li::marker { color: var(--color-text-2); }

.deletion-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

#prepare-button { margin-block-start: var(--space-4); }

/* ---------- Confirmation: the danger zone (rose outline and title, Danger button) ---------- */

.deletion-card--danger { border-color: var(--color-error); }

.deletion-danger__header {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--color-error-text);
}

.deletion-danger__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.deletion-danger__note {
  color: var(--color-text-2);
  font-size: var(--type-app-body-m-size);
  line-height: var(--type-app-body-m-line);
}

/* The expiry line is empty until page.js fills it. */
.deletion-danger__note:empty { display: none; }

.deletion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
}

@media (max-width: 599.98px) {
  .deletion-actions .button { flex: 1 1 100%; }
}

/* ---------- Help, on the page background, aligned with the card text ---------- */

.deletion-help {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-16);
  padding: var(--space-16) var(--space-24) 0;
  color: var(--color-text-2);
}

@media (min-width: 600px) {
  .deletion-help { padding-inline: var(--space-40); }
}

.deletion-help .deletion-card__title { color: var(--color-text); }

.deletion-help__policy {
  font-size: var(--type-small-size);
  line-height: var(--type-small-line);
}

/* The text button's own padding would push its label off the text edge. */
.deletion-help__back { margin-inline-start: calc(-1 * var(--space-12)); }

/* ---------- Forced colours: banners lose their fill, so they keep an edge ---------- */

@media (forced-colors: active) {
  .deletion-status,
  .deletion-banner {
    outline: 1px solid CanvasText;
    outline-offset: -1px;
  }
}
