/* Antes e Depois (scripts/features/utilities/now-next.js). */
.now-next-page {
  display: grid;
  gap: clamp(16px, 3vh, 26px);
}

.now-next-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(12px, 3vw, 32px);
}

.now-next-slot {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.now-next-label {
  color: #172033;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  font-weight: 900;
}

.now-next-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 6px;
  padding: clamp(10px, 2vw, 18px);
  border: 3px solid #dce9f2;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 8px 0 #e3eef6, 0 18px 36px rgba(32, 71, 98, 0.1);
  color: #172033;
  font: inherit;
  box-sizing: border-box;
}

button.now-next-card {
  cursor: pointer;
}

.now-next-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.now-next-card strong {
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  font-weight: 900;
}

.now-next-card:not(.has-card) {
  border-style: dashed;
  grid-template-rows: 1fr;
  background: #f7fbff;
}

.now-next-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #64748b;
  font-weight: 800;
}

.now-next-empty b {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e6f4fe;
  color: var(--app-blue, #1ca7f2);
  font-size: 2.4rem;
  line-height: 1;
}

.now-next-arrow {
  display: grid;
  color: #2fb47c;
}

.now-next-arrow svg {
  width: clamp(44px, 7vw, 76px);
  height: clamp(44px, 7vw, 76px);
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* iPad em pé: uma figura embaixo da outra, seta para baixo. */
@media (orientation: portrait) {
  .now-next-board {
    grid-template-columns: 1fr;
  }

  .now-next-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .now-next-card {
    max-width: min(340px, 27dvh);
  }

  .now-next-board {
    gap: 6px;
  }

  .now-next-slot {
    gap: 6px;
  }
}

/* Página cheia do módulo: o quadro no meio da tela. */
.now-next-page {
  min-height: calc(100dvh - 120px);
  align-content: center;
}

/* Tela cheia / cadeado: figuras maiores, sem os botões. */
body:is(.utility-focus, .utility-locked) .now-next-page {
  min-height: calc(100dvh - 48px);
}

body:is(.utility-focus, .utility-locked) .now-next-card {
  max-width: min(520px, 62dvh);
}

body.utility-locked button.now-next-card {
  cursor: default;
}

@media (orientation: portrait) {
  body:is(.utility-focus, .utility-locked) .now-next-card {
    max-width: min(460px, 39dvh);
  }
}

/* ---------- Cor do fundo do quadro (Antes e Depois) ---------- */
.now-next-card.is-colored {
  border-color: color-mix(in srgb, var(--card-color) 78%, #000000);
  background: var(--card-color);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--card-color) 70%, #000000), 0 18px 36px rgba(32, 71, 98, 0.12);
}

.now-next-card.is-colored img {
  border-radius: 18px;
  background: #ffffff;
}

.now-next-card.is-dark strong,
.now-next-card.is-dark .now-next-empty {
  color: #ffffff;
}

.now-next-card.is-colored:not(.has-card) {
  border-style: solid;
}


/* ---------- 3 quadros: Antes, Agora e Depois ---------- */
.now-next-board.is-three {
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: clamp(8px, 1.6vw, 18px);
}

.now-next-board.is-three .now-next-arrow svg {
  width: clamp(34px, 4.4vw, 56px);
  height: clamp(34px, 4.4vw, 56px);
}

.now-next-board.is-three .now-next-label {
  font-size: clamp(1.3rem, 2.8vw, 2.1rem);
}

.now-next-board.is-three .now-next-card strong {
  font-size: clamp(0.95rem, 1.8vw, 1.35rem);
}

/* Em pé, os 3 quadros continuam lado a lado (um embaixo do outro não caberia). */
@media (orientation: portrait) {
  .now-next-board.is-three {
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 6px;
  }

  .now-next-board.is-three .now-next-arrow {
    transform: none;
  }

  .now-next-board.is-three .now-next-card {
    max-width: none;
  }
}

/* Em pé, fora da tela cheia, os ajustes ficam embaixo: o quadro não precisa ocupar a tela toda. */
@media (orientation: portrait) {
  body:not(.utility-focus):not(.utility-locked) .now-next-page {
    min-height: 0;
    padding: 28px 0 32px;
  }
}

/* ---------- Cor de cada quadro: botão na barra lateral e janelinha com as cores ---------- */
.us-picker {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 0;
  border-radius: 8px;
  background: #ff9f1c;
  box-shadow: 0 5px 0 #d97706, 0 9px 18px rgba(217, 119, 6, 0.2);
  color: #ffffff;
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.us-picker:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #d97706;
}

.us-picker strong {
  flex: 1;
  font-weight: 900;
}

.us-picker-dot {
  width: 32px;
  height: 32px;
  flex: none;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.us-picker-chevron {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.color-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.color-picker {
  width: min(100%, 460px);
  padding: 18px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}

.color-picker header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.color-picker h3 {
  margin: 0;
  color: #172033;
  font-size: 1.3rem;
  font-weight: 900;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.color-picker-option {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 0;
  padding: 10px 4px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #f7fbff;
  color: #1f2f44;
  font: inherit;
  cursor: pointer;
}

.color-picker-option span {
  width: 56px;
  height: 56px;
  border: 2px solid rgba(15, 23, 42, 0.15);
  border-radius: 50%;
  background: var(--swatch);
}

.color-picker-option strong {
  font-size: 0.85rem;
  font-weight: 900;
}

.color-picker-option.is-selected {
  border-color: var(--app-blue, #1ca7f2);
  background: #e9f6ff;
}
