/* =====================================================================
   Açaí do Roxo — Versão HTML/CSS/JS puro
   Design system replicado do projeto React (tokens HEX + oklch moderno)
   ===================================================================== */

:root {
  --radius: 1rem;

  /* Base tokens (compatível com WebViews antigos) */
  --background: #fdf8fe;
  --foreground: #25102d;
  --surface: #f8f0fa;
  --card: #ffffff;
  --card-foreground: #25102d;
  --primary: #712087;
  --primary-foreground: #fdf8fe;
  --brand: #712087;
  --brand-foreground: #fdf8fe;
  --brand-glow: #c54ebe;
  --lime: #a9e44a;
  --lime-foreground: #042d00;
  --secondary: #f6e7fa;
  --secondary-foreground: #4b1759;
  --muted: #f6ecf8;
  --muted-foreground: #74607d;
  --accent: #ffdafb;
  --accent-foreground: #470b56;
  --destructive: #e7000b;
  --destructive-foreground: #f9fafc;
  --border: #e7dbea;
  --input: #e7dbea;
  --ring: #a044ae;

  --gradient-brand: linear-gradient(135deg, #712087, #c54ebe);
  --gradient-soft: linear-gradient(
    160deg,
    rgba(197, 78, 190, 0.12),
    rgba(197, 78, 190, 0) 60%
  );
  --shadow-soft: 0 2px 10px -4px rgba(113, 32, 135, 0.22);
  --shadow-card: 0 18px 40px -24px rgba(113, 32, 135, 0.45);
  --shadow-glow: 0 12px 34px -12px rgba(197, 78, 190, 0.55);
  --transition-smooth: 240ms cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #020618;
    --foreground: #f8fafc;
    --card: #0f172b;
    --card-foreground: #f8fafc;
    --primary: #e2e8f0;
    --primary-foreground: #0f172b;
    --secondary: #1d293d;
    --secondary-foreground: #f8fafc;
    --muted: #1d293d;
    --muted-foreground: #90a1b9;
    --accent: #1d293d;
    --accent-foreground: #f8fafc;
    --destructive: #ff6467;
    --destructive-foreground: #f8fafc;
    --border: rgba(255, 255, 255, 0.1);
    --input: rgba(255, 255, 255, 0.15);
    --ring: #6a7282;
  }
}

@supports (color: oklch(0.5 0.1 320)) {
  :root {
    --background: oklch(0.985 0.008 320);
    --foreground: oklch(0.22 0.06 315);
    --surface: oklch(0.965 0.016 320);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.22 0.06 315);
    --primary: oklch(0.42 0.17 318);
    --primary-foreground: oklch(0.985 0.01 320);
    --brand: oklch(0.42 0.17 318);
    --brand-foreground: oklch(0.985 0.01 320);
    --brand-glow: oklch(0.62 0.2 330);
    --lime: oklch(0.85 0.19 128);
    --lime-foreground: oklch(0.26 0.09 140);
    --secondary: oklch(0.945 0.03 320);
    --secondary-foreground: oklch(0.32 0.12 318);
    --muted: oklch(0.955 0.018 320);
    --muted-foreground: oklch(0.52 0.05 315);
    --accent: oklch(0.93 0.06 330);
    --accent-foreground: oklch(0.3 0.13 318);
    --destructive: oklch(0.577 0.245 27.325);
    --destructive-foreground: oklch(0.985 0.003 250);
    --border: oklch(0.905 0.025 320);
    --input: oklch(0.905 0.025 320);
    --ring: oklch(0.55 0.18 322);
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --background: oklch(0.129 0.042 264.695);
      --foreground: oklch(0.984 0.003 247.858);
      --card: oklch(0.208 0.042 265.755);
      --card-foreground: oklch(0.984 0.003 247.858);
      --primary: oklch(0.929 0.013 255.508);
      --primary-foreground: oklch(0.208 0.042 265.755);
      --secondary: oklch(0.279 0.041 260.031);
      --secondary-foreground: oklch(0.984 0.003 247.858);
      --muted: oklch(0.279 0.041 260.031);
      --muted-foreground: oklch(0.704 0.04 256.788);
      --accent: oklch(0.279 0.041 260.031);
      --accent-foreground: oklch(0.984 0.003 247.858);
      --destructive: oklch(0.704 0.191 22.216);
      --destructive-foreground: oklch(0.984 0.003 247.858);
      --border: oklch(1 0 0 / 10%);
      --input: oklch(1 0 0 / 15%);
      --ring: oklch(0.551 0.027 264.364);
    }
  }
}

@supports (background: color-mix(in oklab, red 50%, transparent)) {
  :root {
    --gradient-brand: linear-gradient(135deg, var(--brand), var(--brand-glow));
    --gradient-soft: linear-gradient(
      160deg,
      color-mix(in oklab, var(--brand-glow) 12%, transparent),
      transparent 60%
    );
    --shadow-soft: 0 2px 10px -4px color-mix(in oklab, var(--brand) 22%, transparent);
    --shadow-card: 0 18px 40px -24px color-mix(in oklab, var(--brand) 45%, transparent);
    --shadow-glow: 0 12px 34px -12px color-mix(in oklab, var(--brand-glow) 55%, transparent);
  }
}

/* ----------------------------- Base ----------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  background-image: var(--gradient-soft);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: none) {
  body {
    background-attachment: scroll;
  }
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-size: 16px; /* evita zoom em WebView/iOS */
}

@media (min-width: 640px) {
  input,
  select,
  textarea {
    font-size: inherit;
  }
}

/* ----------------------------- Page ----------------------------- */
.page {
  min-height: 100vh;
  padding-bottom: 7rem;
}

@media (min-width: 1024px) {
  .page {
    padding-bottom: 4rem;
  }
}

/* ----------------------------- Hero ----------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--brand-foreground);
  background-image: var(--gradient-brand);
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
}

.hero__inner {
  position: relative;
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
  padding: 3.5rem 1rem;
}

@media (min-width: 640px) {
  .hero__inner {
    padding: 5rem 1.5rem;
  }
}

.hero__eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: rgba(253, 248, 254, 0.15);
  padding: 0.375rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.hero__eyebrow svg {
  width: 0.875rem;
  height: 0.875rem;
}

.hero__title {
  max-width: 42rem;
  font-size: 2.5rem;
  line-height: 1.05;
  font-weight: 900;
}

@media (min-width: 640px) {
  .hero__title {
    font-size: 3.75rem;
  }
}

.hero__desc {
  max-width: 36rem;
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.9;
}

@media (min-width: 640px) {
  .hero__desc {
    font-size: 1rem;
  }
}

.hero__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.hero__highlight {
  border-radius: 9999px;
  background: rgba(253, 248, 254, 0.15);
  padding: 0.375rem 0.75rem;
  backdrop-filter: blur(4px);
}

/* ---------------------------- Builder --------------------------- */
.builder {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
  padding: 2rem 1rem;
}

@media (min-width: 640px) {
  .builder {
    padding: 2rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .builder {
    grid-template-columns: minmax(0, 1fr) 22rem;
    align-items: start;
  }
}

.builder__main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .builder__main {
    gap: 1.25rem;
  }
}

.builder__aside {
  display: none;
}

@media (min-width: 1024px) {
  .builder__aside {
    position: sticky;
    top: 1.5rem;
    display: block;
  }
}

/* --------------------------- Progress --------------------------- */
.progress-card {
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 80%, transparent);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
}

.progress-card__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.progress-card__title {
  margin: 0;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.progress-card__pct {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand);
}

.progress-bar {
  margin-top: 0.75rem;
  height: 0.5rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--muted);
}

.progress-bar__fill {
  height: 100%;
  border-radius: 9999px;
  background-image: var(--gradient-brand);
  transition: width var(--transition-smooth);
}

.steps {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.step {
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--muted);
  color: var(--muted-foreground);
  transition: all var(--transition-smooth);
}

.step--active {
  background-image: var(--gradient-brand);
  color: var(--brand-foreground);
}

/* --------------------------- Section ---------------------------- */
.section {
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 80%, transparent);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  transition: all var(--transition-smooth);
}

@media (min-width: 640px) {
  .section {
    padding: 1.75rem;
  }
}

.section--locked {
  pointer-events: none;
  opacity: 0.5;
  user-select: none;
}

.section__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
}

@media (min-width: 640px) {
  .section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

.section__title-group {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}

.section__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 1rem;
  background-image: var(--gradient-brand);
  color: var(--brand-foreground);
  box-shadow: var(--shadow-glow);
}

.section__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.section__step {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.section__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .section__title {
    font-size: 1.25rem;
  }
}

.section__subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.section__badge {
  flex-shrink: 0;
  border-radius: 9999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--secondary);
  color: var(--secondary-foreground);
  transition: all var(--transition-smooth);
}

.section__badge--unlimited {
  background: color-mix(in oklab, var(--lime) 25%, transparent);
  color: var(--lime-foreground);
}

.section__badge--full {
  background-image: var(--gradient-brand);
  color: var(--brand-foreground);
}

.section__grid {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.625rem;
}

@media (min-width: 640px) {
  .section__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .section__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .section__grid--wide {
    grid-column: 1 / -1;
  }
}

.section__note {
  grid-column: 1 / -1;
  margin: 1rem 0 0;
  border-radius: 1rem;
  background: var(--secondary);
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--secondary-foreground);
}

/* ---------------------------- Sizes ----------------------------- */
.sizes {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 1024px) {
  .sizes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.size-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1rem;
  color: var(--card-foreground);
  transition: all var(--transition-smooth);
}

.size-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: var(--shadow-card);
}

.size-card:active {
  transform: translateY(0);
}

.size-card--active {
  border-color: transparent;
  background-image: var(--gradient-brand);
  color: var(--brand-foreground);
  box-shadow: var(--shadow-glow);
}

@media (min-width: 640px) {
  .size-card {
    padding: 1.25rem;
  }
}

.size-card__check {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: var(--muted);
  color: transparent;
  transition: all var(--transition-smooth);
}

.size-card--active .size-card__check {
  background: color-mix(in oklab, var(--brand-foreground) 95%, transparent);
  color: var(--brand);
}

.size-card__check svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke-width: 3;
}

.size-card__cup {
  display: block;
  width: 1.75rem;
  height: 1.5rem;
  border-radius: 0.25rem 0.25rem 9999px 9999px;
  background: color-mix(in oklab, var(--brand) 25%, transparent);
  transition: all var(--transition-smooth);
}

.size-card--active .size-card__cup {
  background: color-mix(in oklab, var(--brand-foreground) 85%, transparent);
}

.size-card__label {
  margin-top: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.size-card__note {
  margin: 0;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.size-card--active .size-card__note {
  color: color-mix(in oklab, var(--brand-foreground) 85%, transparent);
}

.size-card__price {
  margin-top: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

/* ---------------------------- Chips ----------------------------- */
.chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  text-align: left;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  padding: 0.75rem 1rem;
  transition: all var(--transition-smooth);
}

.chip:hover {
  transform: translateY(-0.125rem);
  box-shadow: var(--shadow-soft);
}

.chip:active {
  transform: translateY(0);
}

.chip--selected {
  border-color: transparent;
  background-image: var(--gradient-brand);
  color: var(--brand-foreground);
  box-shadow: var(--shadow-glow);
}

.chip--disabled {
  pointer-events: none;
  opacity: 0.4;
}

.chip__check {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 60%, transparent);
  color: transparent;
  transition: all var(--transition-smooth);
}

.chip--selected .chip__check {
  border-color: transparent;
  background: color-mix(in oklab, var(--brand-foreground) 95%, transparent);
  color: var(--brand);
}

.chip__check svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke-width: 3;
}

.chip__label {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip__price {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.chip--selected .chip__price {
  color: color-mix(in oklab, var(--brand-foreground) 90%, transparent);
}

/* --------------------------- Summary ---------------------------- */
.summary {
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.summary__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.summary__title {
  font-size: 1.125rem;
  font-weight: 700;
}

.summary__tag {
  flex-shrink: 0;
  border-radius: 9999px;
  background: var(--secondary);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary-foreground);
}

.summary__divider {
  height: 1px;
  margin: 1rem 0;
  background: var(--border);
}

.summary__line {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.375rem 0;
}

.summary__line-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.summary__line-value {
  min-width: 0;
  font-size: 0.875rem;
  word-break: break-word;
  color: var(--foreground);
}

.summary__line-value--empty {
  color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
}

.summary__totals {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.summary__totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.summary__totals-row dt {
  color: var(--muted-foreground);
}

.summary__totals-row dd {
  margin: 0;
  font-weight: 600;
}

.summary__total {
  margin-top: 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 1rem;
  background-image: var(--gradient-brand);
  padding: 0.875rem 1rem;
  color: var(--brand-foreground);
  box-shadow: var(--shadow-glow);
}

.summary__total span:first-child {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.9;
}

.summary__total strong {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ----------------------------- Buttons -------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 1rem;
  font-weight: 700;
  transition: all var(--transition-smooth);
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

.btn--xl {
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
}

.btn--whatsapp {
  margin-top: 1rem;
  width: 100%;
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 12px 34px -12px rgba(37, 211, 102, 0.7);
}

.btn--whatsapp:hover {
  background: #1ebe5b;
}

.btn--hero {
  background-image: var(--gradient-brand);
  color: var(--brand-foreground);
  box-shadow: var(--shadow-glow);
}

.btn--hero:hover {
  filter: brightness(1.05);
}

.btn--reset {
  margin-top: 0.75rem;
  width: 100%;
  background: none;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
}

.btn--reset:hover {
  color: var(--brand);
}

.btn--reset svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* --------------------------- Mobile bar ------------------------- */
.mobile-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-card);
}

.mobile-bar {
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

@supports (backdrop-filter: blur(4px)) {
  .mobile-bar {
    background: color-mix(in oklab, var(--card) 95%, transparent);
    backdrop-filter: blur(8px);
  }
}

@media (min-width: 1024px) {
  .mobile-bar {
    display: none;
  }
}

.mobile-bar__label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-bar__total {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

/* ---------------------------- Drawer ---------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  visibility: hidden;
  pointer-events: none;
}

.drawer--open {
  visibility: visible;
  pointer-events: auto;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37, 16, 45, 0.5);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.drawer--open .drawer__backdrop {
  opacity: 1;
}

.drawer__panel {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  box-shadow: var(--shadow-card);
  transform: translateY(100%);
  transition: transform var(--transition-smooth);
}

.drawer--open .drawer__panel {
  transform: translateY(0);
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem 0.5rem;
}

.drawer__title {
  font-size: 1.125rem;
  font-weight: 700;
}

.drawer__close {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 9999px;
  background: var(--muted);
  color: var(--foreground);
}

.drawer__close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.drawer__body {
  overflow-y: auto;
  padding: 0.5rem 1rem 1.5rem;
}

/* ----------------------------- Form ----------------------------- */
.form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field--wide {
  grid-column: 1 / -1;
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.input,
.textarea,
.select select {
  width: 100%;
  height: 2.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--input);
  background: var(--background);
  color: var(--foreground);
  padding: 0 0.875rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition-smooth);
}

.textarea {
  height: auto;
  padding: 0.625rem 0.875rem;
  resize: vertical;
  line-height: 1.4;
}

.input:focus,
.textarea:focus,
.select select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 30%, transparent);
}

.input--error,
.select--error select {
  border-color: var(--destructive);
}

.select {
  position: relative;
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
}

.select__chevron {
  position: absolute;
  top: 50%;
  right: 0.875rem;
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted-foreground);
}

.error {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--destructive);
  min-height: 0;
}

.error:empty {
  display: none;
}

/* ----------------------------- Toasts --------------------------- */
.toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 24rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-card);
  animation: toast-in var(--transition-smooth);
}

.toast--success {
  background: #1e9e57;
}

.toast--error {
  background: var(--destructive);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast--out {
  opacity: 0;
  transform: translateY(-0.5rem);
  transition: all var(--transition-smooth);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
