/* ==========================================================================
   WarZone Conquer account pages.
   Log in, register, recovery, the control panel and its settings forms.
   Mobile is the base; wider screens layer on with min-width. Every value
   comes from tokens.css; new sizes are calc() of existing tokens.
   Pictures come from the shared .wz-art panels in base.css.
   ========================================================================== */

.wz-account {
  --account-title-size: calc(var(--text-base) * 2.5);
  --account-row-height: calc(var(--control-height) + var(--space-4));
  --account-banner: calc(var(--space-16) * 2);
  --account-error-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E");

  padding-block: var(--space-8) 0;
}

@media (min-width: 48rem) {
  .wz-account {
    --account-title-size: calc(var(--text-base) * 2.75);
    --account-banner: calc(var(--space-16) * 2.5);

    padding-block-start: var(--space-16);
  }
}

/* ---------- Page heading, shared by every account page ---------- */

/* Items stretch (no align-items: flex-start), so a long word in the title
   wraps inside the column instead of widening it on a narrow phone. */
.wz-account__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.wz-account__title {
  font-size: var(--account-title-size);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  hyphens: auto;
  overflow-wrap: break-word;
}

.wz-account__lead {
  max-width: var(--measure-lead);
  color: var(--text-secondary);
}

@media (min-width: 48rem) {
  .wz-account__head {
    margin-bottom: var(--space-8);
  }
}

/* ---------- Messages ---------- */

/* Server message (TempData) above a form */
.wz-account__notice {
  margin-bottom: var(--space-6);
}

/* A link inside an alert sits on its own line under the sentence */
.wz-account .wz-alert__body > .wz-account__link {
  display: flex;
  inline-size: fit-content;
  margin-top: var(--space-2);
}

/* Field errors carry an icon as well as colour and text, like the alerts.
   The icon is the same circle-and-bar as the alert glyph, drawn with a mask
   so it takes the error colour. */
.wz-account .field-validation-error::before {
  content: '';
  flex: none;
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
  margin-top: 0.125rem;
  background: currentColor;
  -webkit-mask: var(--account-error-icon) center / contain no-repeat;
  mask: var(--account-error-icon) center / contain no-repeat;
}

/* Client message slot inside a form, filled by account.js */
.wz-account__live:empty {
  display: none;
}

/* Model-level errors from asp-validation-summary; hidden while valid */
.wz-account__summary.validation-summary-errors {
  padding: var(--space-4);
  border: var(--hairline) solid var(--status-danger-border);
  border-radius: var(--radius-sm);
  background: var(--status-danger-surface);
  color: var(--status-danger-text);
}

.wz-account__summary.validation-summary-valid {
  display: none;
}

/* ---------- Form grouping ---------- */

.wz-account__form--grouped {
  gap: var(--space-8);
}

.wz-account__group {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.wz-account__legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  inline-size: 100%;
  margin-bottom: var(--space-4);
  padding: 0;
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-accent);
}

.wz-account__legend::after {
  content: '';
  flex: 1;
  block-size: var(--hairline);
  background: var(--border-subtle);
}

.wz-account__group-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.wz-account__submit {
  margin-top: var(--space-2);
}

/* A full-width action already has room around its label: trim the side
   padding and let a long label wrap on the narrowest phones. */
.wz-account .wz-btn--block {
  padding-inline: var(--space-4);
  white-space: normal;
  text-align: center;
  line-height: var(--leading-snug);
}

/* Links inside the terms checkbox label */
.wz-account .wz-check label a {
  font-weight: var(--weight-semibold);
}

/* ---------- Busy submit ----------
   Loading is not disabled: the button keeps its colour and shows the spinner
   from base.css. It is disabled only to stop a second submit.             */

.wz-account .wz-btn--primary[aria-busy='true']:disabled {
  --btn-bg: var(--action-primary);
  --btn-bg-hover: var(--action-primary);
  --btn-bg-active: var(--action-primary);
  --btn-border: transparent;
  --btn-spinner: var(--text-on-accent);
}

/* ---------- Quiet text links (secondary actions) ---------- */

.wz-account__link {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--space-6);
  font-weight: var(--weight-semibold);
  color: var(--text-accent);
  text-decoration: underline;
  text-decoration-color: var(--border-accent);
}

.wz-account__link:hover {
  color: var(--action-primary-hover);
  text-decoration-color: currentColor;
}

.wz-account__link:active {
  color: var(--action-primary-active);
}

/* ---------- Auth pages: log in, register, recovery ----------
   Phones: the form panel alone. From 64rem the panel leads on the left and a
   picture fills the right, each page with its own class figure. */

.wz-auth__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-10);
}

.wz-auth__panel {
  inline-size: 100%;
  max-inline-size: var(--container-form);
  margin-inline: auto;
  padding: var(--space-5);
}

.wz-auth__alt {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: var(--hairline) solid var(--border-subtle);
  color: var(--text-muted);
}

.wz-auth__alt li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-2);
}

/* The art column only exists on wide screens */
.wz-auth__art {
  display: none;
}

.wz-auth__line {
  max-width: var(--measure-display);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
  color: var(--text-heading);
  text-shadow: var(--text-glow);
  text-wrap: balance;
}

.wz-auth__sign {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-accent);
  text-shadow: var(--text-glow);
}

.wz-auth__sign::before {
  content: '';
  inline-size: var(--space-6);
  block-size: var(--hairline);
  background: currentColor;
}

@media (min-width: 30rem) {
  .wz-auth__panel {
    padding: var(--space-8);
  }
}

@media (min-width: 64rem) {
  .wz-auth__grid {
    grid-template-columns: minmax(0, var(--container-form)) minmax(0, 1fr);
    gap: var(--space-12);
    align-items: stretch;
  }

  .wz-auth__panel {
    margin-inline: 0;
    padding: var(--space-10);
  }

  /* The column stretches to the form's height; the framed art inside it is as
     tall as the window allows (never taller than the form) and stays in view
     while a long form such as register scrolls past. Size containment keeps
     the art from making a short form taller than it needs to be. */
  .wz-auth__art {
    display: block;
    contain: size;
  }

  .wz-auth__art-frame {
    position: sticky;
    top: calc(var(--header-height) + var(--space-6));
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    block-size: calc(100vh - var(--header-height) - var(--space-12));
    min-block-size: calc(var(--space-32) * 3);
    max-block-size: 100%;
    border: var(--hairline) solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
    box-shadow: var(--shadow-raised);
    overflow: hidden;
  }

  /* The crop fills the frame; the bottom scrim sits between it and the line */
  .wz-auth__art-image {
    position: absolute;
    inset: 0;
    z-index: -2;
    border-radius: 0;
  }

  .wz-auth__art-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--hero-scrim-bottom);
  }

  .wz-auth__caption {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-10);
  }
}

/* ---------- Settings pages: change password, change email ---------- */

.wz-settings__inner {
  max-width: calc(var(--container-form) + var(--space-gutter) * 2);
}

.wz-settings__panel {
  padding: var(--space-5);
}

@media (min-width: 30rem) {
  .wz-settings__panel {
    padding: var(--space-8);
  }
}

/* "Back to control panel": the chevron points back and nudges back */
.wz-account__back {
  margin-bottom: var(--space-6);
}

.wz-account__back .wz-icon {
  transform: rotate(180deg);
}

.wz-account__back:hover .wz-icon {
  transform: rotate(180deg) translateX(var(--space-1));
}

.wz-account__tip {
  margin-top: var(--space-6);
}

/* ---------- Control panel ----------
   One thing leads: a tall framed panel with the crimson blade across it and
   the only primary button on the page. Everything else is a quiet list with
   no surface, no icon boxes and body-weight titles, in two groups. */

.wz-cp .wz-account__title {
  font-size: max(var(--account-title-size), var(--text-3xl));
}

.wz-cp__name {
  color: var(--text-accent);
  overflow-wrap: anywhere;
}

/* Phones: the blade band on top, the copy under it */
.wz-cp__lead {
  --cp-pad: var(--space-6);

  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.wz-cp__lead-art {
  --art-pos: 50% 22%;

  flex: none;
  block-size: var(--account-banner);
  border-radius: 0;
}

/* The band melts into the panel surface instead of ending on a hard edge */
.wz-cp__lead-art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, var(--surface-raised), transparent 45%);
}

.wz-cp__lead-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--cp-pad);
}

.wz-cp__lead-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: var(--space-12);
  block-size: var(--space-12);
  border: var(--hairline) solid var(--border-accent);
  border-radius: var(--radius-sm);
  background: var(--action-primary-subtle);
  color: var(--text-accent);
}

.wz-cp__lead-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
}

.wz-cp__lead-text {
  max-width: var(--measure-lead);
  color: var(--text-secondary);
}

.wz-cp__lead-action {
  inline-size: 100%;
  margin-top: var(--space-2);
}

/* The rest: two quiet groups, hairlines only */
.wz-cp__more {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-10);
}

.wz-cp__more-title {
  margin-bottom: var(--space-2);
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.wz-cp__list {
  border: var(--hairline) solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-band);
  overflow: hidden;
}

.wz-cp__list > li + li {
  border-top: var(--hairline) solid var(--border-subtle);
}

.wz-cp__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  min-block-size: var(--account-row-height);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.wz-cp__row:hover {
  background: var(--surface-base);
  color: var(--text-primary);
}

.wz-cp__row:active {
  background: var(--surface-raised);
}

.wz-cp__row:focus-visible {
  outline-offset: calc(var(--focus-width) * -1);
}

.wz-cp__row-icon {
  color: var(--text-subtle);
  transition: color var(--duration-fast) var(--ease-out);
}

.wz-cp__row:hover .wz-cp__row-icon {
  color: var(--text-accent);
}

.wz-cp__row-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.wz-cp__row-title {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

.wz-cp__row-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.wz-cp__row-chevron {
  color: var(--text-subtle);
  transition: transform var(--duration-base) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.wz-cp__row:hover .wz-cp__row-chevron {
  color: var(--text-accent);
  transform: translateX(var(--space-1));
}

@media (min-width: 40rem) {
  .wz-cp__lead-action {
    inline-size: auto;
  }
}

/* The band moves to the right half of the panel and fades in from the copy */
@media (min-width: 48rem) {
  .wz-cp__lead {
    --cp-pad: var(--space-10);

    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    min-block-size: calc(var(--space-32) * 2.5);
  }

  .wz-cp__lead-art {
    --art-pos: 66% 30%;

    order: 2;
    block-size: auto;
  }

  .wz-cp__lead-art::before {
    background: linear-gradient(90deg, var(--surface-raised), transparent 55%);
  }

  .wz-cp__lead-body {
    order: 1;
    justify-content: center;
  }

  .wz-cp__more {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
  }
}

@media (min-width: 64rem) {
  .wz-cp__lead {
    --cp-pad: calc(var(--space-12) + var(--space-2));
  }

  .wz-cp__lead-title {
    font-size: var(--text-3xl);
  }
}
