/* epode TCG: conta de jogador (tcg/account/*.html). Uma folha de papel pousada na mesa, com duas
   cartas viradas por baixo. Palco 1920×1080 ou 1080×1920.

   Escala de leitura: --k multiplica letras, campos e espaços. Paisagem k = 1 (texto de 21 px de palco:
   14 px na tela em 1280×720). Retrato k = 1,7 (o palco de 1080 px cabe em 390 px: 21 × 1,7 = 35,7 px
   de palco dão 12,9 px na tela). Celular deitado (tela baixa) k = 1,5, com a folha em duas colunas. */

.account {
  --k: 1;
  display: grid;
  place-items: center;
  padding: 40px;
}

body[data-orientation='portrait-active'] .account {
  --k: 1.7;
  padding: 250px 56px 40px;
}

@media (max-height: 560px) {
  body[data-orientation='landscape'] .account {
    --k: 1.5;
  }
}

.account__back {
  position: absolute;
  top: 36px;
  left: 40px;
  z-index: 3;
  min-height: calc(52px * var(--k));
  padding: 0 calc(20px * var(--k)) 0 calc(14px * var(--k));
  font-size: calc(21px * var(--k));
}

.account__back .tcg-icon {
  width: calc(22px * var(--k));
  height: calc(22px * var(--k));
}

/* A mesa: a folha com duas cartas viradas por baixo (só decoração), presas à folha e não ao palco. */
.account__desk {
  position: relative;
  z-index: 1;
  display: grid;
  max-height: 100%;
}

body[data-orientation='portrait-active'] .account__desk {
  width: 100%;
}

.account__table {
  position: absolute;
  inset: 0;
}

.account__card {
  position: absolute;
  width: 300px;
  height: 420px;
  border-radius: 14px;
  background: var(--paper) url('../img/card-back.svg') center / 100% 100% no-repeat;
  box-shadow: var(--shadow-lift);
}

.account__card--a {
  top: 24px;
  left: -232px;
  rotate: -9deg;
}

.account__card--b {
  right: -236px;
  bottom: 30px;
  rotate: 7deg;
}

body[data-orientation='portrait-active'] .account__card--a {
  top: -226px;
  left: 250px;
}

body[data-orientation='portrait-active'] .account__card--b {
  top: -206px;
  right: 40px;
  bottom: auto;
}

.account-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: stretch;
  gap: calc(20px * var(--k));
  width: 660px;
  max-height: 100%;
  min-width: 0;
  padding: calc(40px * var(--k)) calc(56px * var(--k)) calc(36px * var(--k));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
}

.account-sheet__brand,
.account-sheet__form {
  display: grid;
  gap: calc(20px * var(--k));
  min-width: 0;
}

/* Fita de papel prendendo a folha na mesa. */
.account-sheet::before {
  content: '';
  position: absolute;
  top: calc(-16px * var(--k));
  left: 50%;
  width: calc(150px * var(--k));
  height: calc(34px * var(--k));
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper-shade) 82%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 18%, transparent);
  translate: -50% 0;
  rotate: -2deg;
}

.account-sheet__logo {
  justify-self: center;
  width: calc(150px * var(--k));
  height: auto;
}

.account-sheet__title {
  margin-top: 4px;
  color: var(--ink);
  font-size: calc(54px * var(--k));
  line-height: 1.05;
  text-align: center;
}

.account-sheet__lead {
  margin-top: calc(-8px * var(--k));
  color: var(--on-paper-muted);
  font: 500 calc(23px * var(--k))/1.35 var(--font-ui);
  text-align: center;
}

.account-sheet__bonus {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: calc(10px * var(--k));
  margin-top: -4px;
  padding: calc(8px * var(--k)) calc(18px * var(--k)) calc(8px * var(--k)) calc(14px * var(--k));
  border: var(--line) dashed var(--forest);
  border-radius: 999px;
  color: var(--forest);
  font: 600 calc(21px * var(--k))/1.2 var(--font-ui);
}

.account-sheet__bonus .tcg-icon {
  width: calc(24px * var(--k));
  height: calc(24px * var(--k));
}

.account-sheet__bonus strong,
.account-sheet__bonus span {
  white-space: nowrap;
}

.account-sheet__bonus strong {
  font: 600 calc(24px * var(--k))/1 var(--font-display);
  font-variation-settings: var(--fraunces-axes);
}

.account-sheet__alert {
  padding: calc(12px * var(--k)) calc(18px * var(--k));
  border-left: 5px solid var(--wine);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--wine) 10%, transparent);
  color: var(--wine);
  font: 600 calc(21px * var(--k))/1.35 var(--font-ui);
}

.account-sheet__fields {
  display: grid;
  gap: calc(16px * var(--k));
  margin-top: 4px;
}

.account-field {
  display: grid;
  gap: calc(8px * var(--k));
}

.account-field__label {
  color: var(--ink);
  font: 600 calc(22px * var(--k))/1.2 var(--font-ui);
}

.account-field input {
  width: 100%;
  min-height: calc(62px * var(--k));
  padding: 0 calc(20px * var(--k));
  border: var(--line) solid color-mix(in srgb, var(--ink) 55%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 45%, var(--highlight));
  color: var(--ink);
  font: 500 calc(24px * var(--k))/1.2 var(--font-ui);
  transition: border-color var(--dur-ui) var(--ease-out);
}

.account-field input:hover,
.account-field input:focus-visible {
  border-color: var(--ink);
}

.account-field input:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: 2px;
}

.account-field.has-error input {
  border-color: var(--wine);
  box-shadow: 0 0 0 1.5px var(--wine);
}

.account-field__hint {
  color: var(--on-paper-muted);
  font: 500 calc(21px * var(--k))/1.3 var(--font-ui);
}

.account-field__errors {
  display: grid;
  gap: 4px;
  color: var(--wine);
  font: 600 calc(21px * var(--k))/1.3 var(--font-ui);
}

.account-sheet__submit.btn {
  width: 100%;
  min-height: calc(66px * var(--k));
  margin-top: calc(6px * var(--k));
  font-size: calc(23px * var(--k));
}

.account-sheet__submit .tcg-icon {
  width: calc(24px * var(--k));
  height: calc(24px * var(--k));
}

.account-sheet__switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 calc(6px * var(--k));
  color: var(--on-paper-muted);
  font: 500 calc(22px * var(--k))/1.3 var(--font-ui);
  text-align: center;
}

/* Link com alvo de toque de 48 px de palco (spec 6.5). */
.account-sheet__switch a {
  display: inline-flex;
  align-items: center;
  min-height: calc(48px * var(--k));
  padding: 0 calc(6px * var(--k));
  border-radius: var(--radius-sm);
  color: var(--forest);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.account-sheet__switch a:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: 2px;
}

/* Aviso dos documentos no cadastro: discreto, com links sublinhados. */
.account-sheet__legal {
  margin: 0;
  color: var(--on-paper-muted);
  font: 500 calc(19px * var(--k))/1.45 var(--font-ui);
  text-align: center;
}

.account-sheet__legal a {
  color: var(--forest);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-sheet__legal a:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: 2px;
}

/* Retrato: a folha ocupa a largura e as cartas espiam por cima. */
body[data-orientation='portrait-active'] .account-sheet {
  width: 100%;
  gap: calc(16px * var(--k));
  padding: calc(34px * var(--k)) calc(40px * var(--k)) calc(30px * var(--k));
}

body[data-orientation='portrait-active'] .account-sheet__brand,
body[data-orientation='portrait-active'] .account-sheet__form {
  gap: calc(16px * var(--k));
}

body[data-orientation='portrait-active'] .account-sheet__fields {
  gap: calc(12px * var(--k));
}

/* Celular deitado: folha larga em duas colunas (marca à esquerda, campos à direita), campos mais baixos. */
@media (max-height: 560px) {
  body[data-orientation='landscape'] .account {
    padding: 24px;
  }

  body[data-orientation='landscape'] .account-sheet {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: center;
    column-gap: 56px;
    width: 1360px;
    padding: calc(24px * var(--k)) calc(40px * var(--k));
  }

  body[data-orientation='landscape'] .account-sheet__brand {
    align-content: center;
    justify-items: center;
    gap: calc(14px * var(--k));
  }

  body[data-orientation='landscape'] .account-sheet__form {
    gap: calc(10px * var(--k));
  }

  body[data-orientation='landscape'] .account-sheet__fields {
    gap: calc(8px * var(--k));
  }

  body[data-orientation='landscape'] .account-field {
    gap: calc(5px * var(--k));
  }

  body[data-orientation='landscape'] .account-field input {
    min-height: calc(54px * var(--k));
  }

  body[data-orientation='landscape'] .account-sheet__submit.btn {
    min-height: calc(58px * var(--k));
    margin-top: 0;
  }

  body[data-orientation='landscape'] .account-sheet__switch a {
    min-height: calc(44px * var(--k));
  }

  body[data-orientation='landscape'] .account-sheet__title {
    font-size: calc(48px * var(--k));
  }

  /* Coluna estreita: "60 créditos" e "de boas-vindas" em duas linhas centradas. */
  body[data-orientation='landscape'] .account-sheet__bonus {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 4px;
    border-radius: var(--radius-lg);
    text-align: center;
  }

  body[data-orientation='landscape'] .account__card--a {
    top: auto;
    bottom: 30px;
    left: -250px;
  }

  body[data-orientation='landscape'] .account__card--b {
    top: 24px;
    right: -250px;
    bottom: auto;
  }
}
