:root {
  --brick: #B8481F;
  --brick-dark: #9a3a17;
  --cream: #F7EEE1;
  --cream-bg: #efe6d7;
  --gold: #D99A2B;
  --gold-light: #F1C877;
  --text-brown: #5c3a26;
  --text-brown-light: #4a2f1e;
  --text-brown-soft: #a06a3c;
  --error: #c0392b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--cream-bg);
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--text-brown);
}

button { font-family: inherit; }

/* App shell: full-bleed on phones, centered card on larger screens */
.app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
}

@media (min-width: 560px) {
  .app {
    min-height: 90vh;
    margin: 5vh auto;
    border-radius: 36px;
    box-shadow: 0 30px 70px -20px rgba(60, 25, 10, .45), 0 4px 14px rgba(0, 0, 0, .25);
  }
}

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 560px) {
  .screen { min-height: 90vh; }
}

.screen[hidden] { display: none; }

.screen--brick {
  background: var(--brick);
  color: var(--cream);
}

.screen--cream { background: var(--cream); }

.screen--center {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 34px;
}

/* Decorative background circles */
.deco-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.deco-circle--top {
  top: -70px; right: -60px;
  width: 240px; height: 240px;
  background: rgba(217, 154, 43, .28);
}
.deco-circle--bottom {
  bottom: -90px; left: -70px;
  width: 260px; height: 260px;
  background: rgba(247, 238, 225, .10);
}
.deco-circle--done {
  top: -60px; left: -50px;
  width: 200px; height: 200px;
  background: rgba(217, 154, 43, .25);
}

/* Loading / error */
.loading-text { font-size: 17px; font-weight: 700; color: var(--text-brown-soft); }

.error-icon { font-size: 44px; margin-bottom: 18px; }
.error-title {
  margin: 0 0 12px;
  font-family: 'DM Serif Display', serif;
  font-size: 34px;
  font-weight: 400;
  color: var(--brick);
}
.error-message {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-brown);
  max-width: 320px;
}
.error-hint {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-brown-soft);
  max-width: 300px;
}

/* SCREEN 1 : ACCUEIL */
.home-brand {
  position: relative;
  padding: 64px 30px 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.home-brand-icon {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.home-brand-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(247, 238, 225, .82);
}

.home-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 30px;
}
.home-eyebrow {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--gold-light);
  text-transform: uppercase;
}
.home-title {
  margin: 0 0 26px;
  font-family: 'DM Serif Display', serif;
  font-size: 58px;
  line-height: .98;
  font-weight: 400;
  overflow-wrap: break-word;
}
.home-lead {
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 600;
  color: rgba(247, 238, 225, .94);
  max-width: 320px;
}
.home-lead-accent { color: var(--gold-light); }

.home-cta { position: relative; padding: 0 24px 40px; }

.btn {
  width: 100%;
  padding: 20px;
  border: none;
  border-radius: 18px;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s, opacity .2s;
}
.btn:active { transform: translateY(1px); }

.btn--light {
  background: var(--cream);
  color: var(--brick);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .4);
}
.btn--light:hover { transform: translateY(-2px); }

.btn--brick {
  background: var(--brick);
  color: var(--cream);
  box-shadow: 0 12px 26px -8px rgba(184, 72, 31, .6);
}
.btn--brick:disabled {
  background: rgba(184, 72, 31, .18);
  color: rgba(90, 58, 38, .5);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* SCREEN 2 : ACTION */
.topbar {
  padding: 58px 24px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(184, 72, 31, .25);
  background: #fff;
  color: var(--brick);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  flex: none;
}
.topbar-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}
.topbar-title {
  font-family: 'DM Serif Display', serif;
  font-size: 23px;
  color: var(--brick);
  line-height: 1.05;
}

.form-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 20px;
  -webkit-overflow-scrolling: touch;
}

.field-label {
  display: block;
  margin: 12px 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-brown);
}

.handle-input-wrap {
  position: relative;
}

.handle-prefix {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-brown-light);
  pointer-events: none;
}

.input-handle {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px 16px 38px;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-brown-light);
  background: #fff;
  outline: none;
  border: 2px solid rgba(184, 72, 31, .18);
  transition: border-color .15s, box-shadow .15s;
}
.input-handle.is-valid {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 154, 43, .15);
}
.input-handle.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .12);
}

.field-error {
  margin: 8px 2px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--error);
}

.photo-block { margin-top: 24px; }

.photo-dropzone {
  width: 100%;
  padding: 30px 20px;
  border: 2px dashed rgba(184, 72, 31, .4);
  border-radius: 18px;
  background: rgba(217, 154, 43, .09);
  color: var(--brick);
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.photo-icon { font-size: 30px; }
.photo-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-brown-soft);
}

.photo-preview {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 20px -8px rgba(120, 50, 20, .4);
}
.photo-preview img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.photo-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(20, 12, 8, .6);
  color: var(--cream);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}
.btn-change {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(247, 238, 225, .95);
  color: var(--brick);
  border: none;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 22px;
  cursor: pointer;
}

.consent-row {
  margin-top: 22px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid rgba(184, 72, 31, .14);
  cursor: pointer;
}
.consent-checkbox {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--brick);
  cursor: pointer;
}
.consent-text {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-brown);
}

.submit-error {
  margin: 16px 2px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--error);
}

.submit-bar {
  padding: 12px 24px 34px;
  background: linear-gradient(to top, var(--cream) 65%, rgba(247, 238, 225, 0));
}

/* SCREEN 3 : CONFIRMATION */
@keyframes vat-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes vat-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

.done-badge {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  margin-bottom: 30px;
  animation: vat-pop .5s ease-out both;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .4);
}
.done-title {
  margin: 0 0 22px;
  font-family: 'DM Serif Display', serif;
  font-size: 46px;
  line-height: 1;
  font-weight: 400;
  animation: vat-rise .5s .1s ease-out both;
}
.done-lead {
  margin: 0 0 30px;
  font-size: 22px;
  line-height: 1.45;
  font-weight: 700;
  max-width: 320px;
  animation: vat-rise .5s .2s ease-out both;
}
.done-card {
  margin-top: 28px;
  padding: 20px 22px;
  border-radius: 18px;
  background: rgba(247, 238, 225, .14);
  border: 1.5px solid rgba(247, 238, 225, .3);
  animation: vat-rise .5s .4s ease-out both;
}
.done-card p {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 800;
  color: var(--gold-light);
}

.done-instagram-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(247, 238, 225, .4);
  color: rgba(247, 238, 225, .9);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  animation: vat-rise .5s .3s ease-out both;
}
.done-instagram-btn:hover {
  background: rgba(247, 238, 225, .12);
  border-color: rgba(247, 238, 225, .65);
  color: var(--gold-light);
}
.done-instagram-btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}
