/* ================================================================
   Toul'Evenement - Validation de devis
   Charte : gris anthracite + rouge ToulEvenement
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Open+Sans:wght@300;400;600&display=swap');

:root {
  --red:         #c0392b;
  --red-dark:    #a93226;
  --red-light:   #e74c3c;
  --red-bg:      rgba(192,57,43,.08);
  --red-border:  rgba(192,57,43,.25);

  --grey-900:    #1e1e1e;
  --grey-800:    #2c2c2c;
  --grey-700:    #3d3d3d;
  --grey-600:    #555555;
  --grey-400:    #999999;
  --grey-200:    #e0e0e0;
  --grey-100:    #f4f4f4;
  --grey-50:     #fafafa;
  --white:       #ffffff;

  --bg:          #b0b0b0;
  --bg-card:     #ffffff;
  --border:      #c0392b;
  --text:        var(--grey-900);
  --text-muted:  var(--grey-600);
  --text-dim:    var(--grey-400);
  --success:     #27ae60;
  --success-bg:  rgba(39,174,96,.08);
  --success-border: rgba(39,174,96,.3);

  --font-display: 'Montserrat', sans-serif;
  --font-body:    'Open Sans', sans-serif;
  --radius:       8px;
  --radius-sm:    5px;
  --shadow:       0 2px 12px rgba(0,0,0,.08);
  --shadow-card:  0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ── */
.page-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.main-content {
  flex: 1;
  max-width: 780px; margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  width: 100%;
}

/* ── Header ── */
.site-header {
  background: var(--grey-900);
  border-bottom: 3px solid var(--red);
}
.header-inner {
  max-width: 780px; margin: 0 auto;
  padding: .9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: .9rem; }
.brand-logo {
  height: 44px; width: auto;
  display: block;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  color: var(--white); letter-spacing: .02em;
}
.header-tag {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--grey-400);
  border: 1px solid var(--grey-700);
  padding: .25rem .7rem; border-radius: 99px;
}

/* ── Footer ── */
.site-footer {
  background: var(--grey-900);
  border-top: 3px solid var(--red);
  text-align: center;
  padding: 1rem 1.25rem;
  font-size: .8rem; color: var(--grey-400);
}
.site-footer a { color: var(--red-light); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Step indicator ── */
.step-indicator {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 2rem; padding-top: .5rem;
}
.step {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600;
  border: 2px solid var(--border);
  color: var(--text-muted); background: var(--white);
  transition: all .3s;
}
.step.active  { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.step.done    { border-color: var(--success); color: var(--white); background: var(--success); }
.step-line    { width: 48px; height: 2px; background: var(--border); transition: background .3s; }
.step-line.active { background: var(--red); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
  border: 2px solid var(--red);
}

/* ── Intro card ── */
.intro-card { text-align: center; }
.brand-logo-hero {
  height: 56px; width: auto; margin: 0 auto 1.25rem;
  display: block;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: .5rem; color: var(--grey-900);
}
.card-subtitle { color: var(--text-muted); margin-bottom: 1.75rem; max-width: 520px; margin-left: auto; margin-right: auto; }

/* ── Forms ── */
.field-label {
  display: block; font-size: .78rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  font-weight: 600; margin-bottom: .35rem;
}
.required-star { color: var(--red); }
.field-input {
  width: 100%; padding: .65rem .9rem;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body);
  font-size: .95rem; transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.field-input::placeholder { color: var(--text-dim); }
.field-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.field-hint { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; }
.field-group { display: flex; gap: .75rem; }
.field-group .field-input { flex: 1; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 540px) { .fields-grid { grid-template-columns: 1fr; } .field-group { flex-direction: column; } }
.field-block { display: flex; flex-direction: column; }
.field-block--full { grid-column: 1 / -1; }

/* ── Upload tampon ── */
.upload-block { margin-top: .75rem; }
.file-input-wrapper {
  position: relative;
  display: flex; align-items: center; gap: .75rem;
}
.file-input-hidden {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%;
}
.file-input-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--grey-400);
  background: var(--grey-50); color: var(--text-muted);
  font-size: .85rem; cursor: pointer; white-space: nowrap;
  transition: border-color .2s, color .2s;
}
.file-input-btn:hover { border-color: var(--red); color: var(--red); }
.file-input-name {
  font-size: .82rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-preview-box {
  display: none; margin-top: .75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .5rem; background: var(--grey-50); text-align: center;
}
.file-preview-box img { max-height: 120px; max-width: 100%; border-radius: 3px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.3rem; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .2s; border: none; text-decoration: none;
  white-space: nowrap; letter-spacing: .02em;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(192,57,43,.3); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: var(--white); color: var(--grey-700); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--red); color: var(--red); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); font-size: .8rem; padding: .35rem .75rem; }
.btn-ghost:hover { color: var(--red); border-color: var(--red); }
.btn-sm { padding: .35rem .85rem; font-size: .78rem; }
.btn-large { padding: .95rem 2rem; font-size: 1rem; border-radius: var(--radius); }
.btn-arrow { transition: transform .2s; }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }
.btn-icon { font-size: .9rem; }

/* ── Alerts ── */
.alert {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .8rem 1rem; border-radius: var(--radius-sm);
  margin-bottom: 1.25rem; font-size: .88rem;
}
.alert-error  { background: rgba(192,57,43,.07); border: 1px solid var(--red-border); color: var(--red-dark); }
.alert-success{ background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }
.alert-icon   { font-weight: 700; flex-shrink: 0; }

/* ── Info strip ── */
.info-strip {
  display: flex; justify-content: center; gap: 2rem;
  flex-wrap: wrap; margin-top: .5rem;
}
.info-item { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--text-muted); }

/* ── Proforma card ── */
.proforma-label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: .6rem; }
.proforma-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem 1rem; background: var(--grey-50);
  border: 1.5px solid var(--red-border); border-radius: var(--radius-sm);
  color: var(--red); text-decoration: none; font-size: .88rem;
  transition: background .2s; word-break: break-all;
}
.proforma-link:hover { background: var(--red-bg); }
.proforma-link-icon { font-size: 1.1rem; flex-shrink: 0; }
.proforma-link-ext  { margin-left: auto; flex-shrink: 0; }
.proforma-hint { font-size: .8rem; color: var(--text-muted); margin-top: .6rem; }

/* ── Section titles ── */
.section-title {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .5rem; color: var(--grey-900);
  border-bottom: 2px solid var(--red); padding-bottom: .6rem;
}
.section-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--red); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.section-intro { color: var(--text-muted); font-size: .88rem; margin-bottom: 1.25rem; margin-top: .5rem; }

/* ── CGV list ── */
.cgv-list { display: flex; flex-direction: column; gap: .6rem; }
.cgv-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; background: var(--grey-50);
  transition: border-color .2s, background .2s;
}
.cgv-item.accepted { border-color: var(--success-border); background: var(--success-bg); }
.cgv-item-header { display: flex; align-items: center; gap: .55rem; margin-bottom: .4rem; }
.cgv-item-icon  { font-size: 1rem; flex-shrink: 0; }
.cgv-item-title { font-weight: 600; font-size: .9rem; color: var(--grey-800); }
.cgv-item-body  { color: var(--text-muted); font-size: .83rem; line-height: 1.6; margin-bottom: .75rem; }
.cgv-link { color: var(--red); text-decoration: underline; }

.checkbox-row {
  display: flex; align-items: flex-start; gap: .65rem;
  cursor: pointer; user-select: none;
}
.checkbox-row input[type="checkbox"] { display: none; }
.checkbox-custom {
  width: 18px; height: 18px; border-radius: 3px; flex-shrink: 0; margin-top: 2px;
  border: 2px solid var(--grey-400); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.checkbox-row input:checked + .checkbox-custom {
  background: var(--success); border-color: var(--success);
}
.checkbox-row input:checked + .checkbox-custom::after {
  content: '\2713'; color: #fff; font-size: .7rem; font-weight: 700;
}
.checkbox-custom--red { border-color: var(--red) !important; }
.checkbox-row input:checked + .checkbox-custom--red {
  background: var(--red) !important; border-color: var(--red) !important;
}
.checkbox-row input:checked + .checkbox-custom--red::after {
  content: '\2713'; color: #fff; font-size: .7rem; font-weight: 700;
}
.checkbox-label { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }
.checkbox-row:hover .checkbox-label { color: var(--text); }

.check-all-row {
  display: flex; align-items: center; gap: 1rem;
  margin-top: 1rem; padding-top: .85rem;
  border-top: 1px solid var(--border);
}
.check-progress { font-size: .8rem; color: var(--text-muted); }
.check-progress.complete { color: var(--success); font-weight: 600; }

/* ── Signer type toggle ── */
.signer-type-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
  margin-bottom: 1.5rem;
}
.type-option {
  display: flex; align-items: center;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: .8rem 1rem; cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--grey-50);
}
.type-option input { display: none; }
.type-option:hover { border-color: var(--red); background: var(--red-bg); }
.type-option.selected { border-color: var(--red); background: var(--red-bg); }
.type-radio-custom {
  width: 17px; height: 17px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--grey-400); background: var(--white);
  margin-right: .75rem; transition: all .2s; position: relative;
}
.type-option.selected .type-radio-custom {
  border-color: var(--red);
}
.type-option.selected .type-radio-custom::after {
  content: ''; position: absolute;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.type-label { display: flex; align-items: center; gap: .6rem; }
.type-icon  { font-size: 1.1rem; }
.type-text  { display: flex; flex-direction: column; }
.type-text strong { font-size: .88rem; font-weight: 600; color: var(--grey-900); }
.type-text small  { font-size: .75rem; color: var(--text-muted); }
@media (max-width: 480px) { .signer-type-toggle { grid-template-columns: 1fr; } }

/* ── Entreprise fields ── */
.entreprise-fields { margin-top: 1rem; }
.entreprise-fields.hidden { display: none; }
.fields-divider {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1rem; color: var(--text-muted); font-size: .75rem;
  letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
}
.fields-divider::before, .fields-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Mandate box ── */
.mandate-box {
  margin-top: 1rem; padding: .9rem 1rem;
  background: var(--red-bg); border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
}

/* ── Bon pour accord ── */
.bpa-box {
  margin-top: 1.25rem; padding: 1rem 1.1rem;
  background: var(--grey-900); border-radius: var(--radius-sm);
}
.checkbox-row--bpa .checkbox-label { color: var(--grey-200); }
.checkbox-row--bpa .checkbox-label strong { color: var(--white); }
.checkbox-row--bpa .checkbox-custom { border-color: var(--grey-400); background: var(--grey-800); }
.checkbox-row--bpa input:checked + .checkbox-custom {
  background: var(--red) !important; border-color: var(--red) !important;
}
.checkbox-row--bpa input:checked + .checkbox-custom::after {
  content: '\2713'; color: #fff; font-size: .7rem; font-weight: 700;
}
.checkbox-row--mandate .checkbox-label { font-size: .85rem; }

/* ── Signature recap ── */
.sig-identity-recap {
  padding: .5rem .9rem; margin-bottom: .75rem;
  background: var(--grey-50); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: .85rem; color: var(--text-muted);
  min-height: 2.1rem; display: flex; align-items: center;
}
.sig-recap-text { font-style: italic; }

/* ── Canvas ── */
.canvas-wrapper {
  position: relative; border-radius: var(--radius-sm);
  border: 2px dashed var(--grey-400); overflow: hidden; cursor: crosshair;
  background: #fff; margin-bottom: .75rem;
}
.canvas-wrapper:hover { border-color: var(--red); }
#sig-canvas { display: block; width: 100%; height: 180px; }
#canvas-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey-400); font-size: .95rem; letter-spacing: .1em;
  pointer-events: none; transition: opacity .3s;
  font-family: var(--font-display);
}
.canvas-actions { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.sig-status { font-size: .8rem; color: var(--text-muted); }
.sig-status.signed { color: var(--success); font-weight: 600; }

/* ── Legal mention ── */
.legal-mention {
  font-size: .78rem; color: var(--text-muted); line-height: 1.6;
  padding: .8rem 1rem; background: var(--grey-50);
  border-left: 3px solid var(--red); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Submit ── */
.submit-zone { text-align: center; margin-top: .5rem; }
.submit-hint { font-size: .8rem; color: var(--text-muted); margin-top: .75rem; transition: opacity .3s; }

/* ── Confirmation ── */
.confirm-card { text-align: center; }
.confirm-hero { padding: 1.5rem 0 1.75rem; }
.confirm-checkmark {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--success-bg); border: 2px solid var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--success);
  margin: 0 auto 1rem;
  animation: pop .4s cubic-bezier(.175,.885,.32,1.275) both;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--grey-900); margin-bottom: .5rem; }
.confirm-sub { color: var(--text-muted); }
.confirm-details { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 1.5rem 0; }
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .65rem 1rem; border-bottom: 1px solid var(--border); font-size: .88rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { color: var(--text); font-weight: 600; }
.mono { font-family: 'Courier New', monospace; font-size: .8rem; }
.confirm-info {
  display: flex; gap: .75rem; align-items: flex-start;
  background: var(--red-bg); border: 1px solid var(--red-border);
  border-radius: var(--radius-sm); padding: .9rem 1rem;
  text-align: left; font-size: .88rem; margin-bottom: 1.5rem;
}
.confirm-info-icon { font-size: 1.1rem; flex-shrink: 0; }
.confirm-actions { display: flex; justify-content: center; gap: 1rem; }

/* ── URL form ── */
.url-form { margin-bottom: 1.5rem; text-align: left; max-width: 600px; margin-left: auto; margin-right: auto; }
