:root {
  --ground: #FBF7F3;
  --ink: #2A2522;
  --muted: #6B5F58;
  --line: #EDE3DA;
  --field: #DCCFC4;
  --rose: #8E4F40;
  --rose-soft: #F5E9E3;
  --plum: #2B2024;
  --disabled: #BCA89E;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--ground); color: var(--ink); }
body { font-family: 'DM Sans', system-ui, sans-serif; font-size: 16px; -webkit-font-smoothing: antialiased; }
.serif { font-family: 'Cormorant Garamond', Georgia, serif; }
.app { max-width: 460px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: none; flex-direction: column; padding: 24px 20px 32px; gap: 18px; }
.screen.active { display: flex; }
.spacer { flex: 1; }
h1, h2 { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; line-height: 1.15; }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
p { margin: 0; line-height: 1.45; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.step { font-size: 13px; font-weight: 500; color: var(--muted); }

.brand { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; line-height: 1; }
.brand-sub { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }

label { font-size: 14px; font-weight: 500; display: block; margin-bottom: 6px; }
.field { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--field); border-radius: 12px; height: 56px; padding: 0 14px; }
.field span { color: var(--muted); font-size: 17px; }
.field input, input.input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 18px; color: var(--ink); }
input.input, select.input { flex: none; height: 56px; border: 1px solid var(--field); border-radius: 12px; background: #fff; padding: 0 14px; width: 100%; font: inherit; font-size: 17px; color: var(--ink); }
select.input { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B5F58' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center; padding-right: 40px; }
.field:focus-within, input.input:focus, select.input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(142,79,64,0.15); }

.btn { height: 56px; width: 100%; border: none; border-radius: 14px; background: var(--plum); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn.rose { background: var(--rose); }
.btn.ghost { background: #fff; color: var(--rose); border: 1px solid var(--rose); height: 48px; }
.btn:disabled { background: var(--disabled); cursor: default; }
.link { background: none; border: none; padding: 10px 0; color: var(--rose); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; text-align: center; }
.back { width: 44px; height: 44px; margin: -8px 0 0 -10px; border: none; background: none; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }

.error { display: none; background: #FBE9E7; color: #8A2A1C; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.4; }
.error.show { display: block; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; }
.ico { width: 40px; height: 40px; border-radius: 12px; background: var(--rose-soft); color: var(--rose); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Carte */
.card { border-radius: 22px; padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 12px 28px rgba(43,32,36,0.22); }
.card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.card .cbrand { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 26px; font-weight: 700; }
.card .csmall { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.card .badge { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; border-radius: 999px; padding: 6px 12px; }
.card .big { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 64px; font-weight: 600; line-height: 1; }
.card .track { height: 8px; border-radius: 999px; overflow: hidden; }
.card .bar { height: 100%; border-radius: 999px; width: 0; transition: width .6s ease; }
.card .foot { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid; }
.card .cname { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 22px; font-weight: 600; line-height: 1.1; }
.qrbox { background: #fff; border-radius: 16px; padding: 14px; display: flex; gap: 14px; align-items: center; color: var(--ink); }
.qrbox .qr { width: 96px; height: 96px; flex-shrink: 0; }
.qrbox .qr svg { width: 100%; height: 100%; display: block; }

.voucher { border-radius: 14px; background: var(--rose); color: #fff; padding: 14px 16px; text-align: center; line-height: 1.4; }
.grid-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 12px; background: #FAF6F2; }
.grid-row.ok { background: var(--rose-soft); color: #6E3B30; }
.swatch { width: 40px; height: 28px; border-radius: 6px; flex-shrink: 0; }
.pill { font-size: 12px; font-weight: 700; color: var(--rose); background: var(--rose-soft); border-radius: 999px; padding: 4px 10px; }
.install { background: var(--rose-soft); border-radius: 14px; padding: 14px 16px; display: none; flex-direction: column; gap: 10px; }
.install.show { display: flex; }
.loading { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); }
