:root {
  --gradient-start: #0D1B4B;
  --gradient-mid1: #1A3A6B;
  --gradient-mid2: #0E4D6B;
  --gradient-end: #0A6E82;
  --cyan: #00B4D8;
  --green: #26D07C;
  --red-cta: #E84855;
  --error-bg: #FFF5F5;
  --white: #FFFFFF;
  --white-60: rgba(255, 255, 255, 0.6);
  --white-80: rgba(255, 255, 255, 0.8);
  --cosmos-gradient: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid1) 35%, var(--gradient-mid2) 68%, var(--gradient-end) 100%);
  --progress-gradient: linear-gradient(90deg, var(--cyan), var(--green));
  --font: 'Outfit', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--white);
  background: var(--cosmos-gradient);
  overflow-x: hidden;
}

body { min-height: 100vh; }

img { max-width: 100%; display: block; }

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
}

input, select, textarea {
  font-family: var(--font);
}

a { color: var(--cyan); }

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════
   BOKEH
════════════════════════════════════════════════════════ */
.bokeh-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bokeh-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  will-change: transform;
  transition: transform 0.6s ease-out;
}

.bokeh-sphere.cyan { background: radial-gradient(circle at 35% 35%, var(--cyan), transparent 70%); }
.bokeh-sphere.green { background: radial-gradient(circle at 35% 35%, var(--green), transparent 70%); }
.bokeh-sphere.white { background: radial-gradient(circle at 35% 35%, var(--white), transparent 70%); }

/* ═══════════════════════════════════════════════════════
   LANDING — HERO
════════════════════════════════════════════════════════ */
#landing {
  position: relative;
  width: 100%;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  animation: badgePulse 2.6s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(0, 180, 216, 0); }
}

.hero-title {
  font-size: clamp(32px, 5.5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
}

.hero-title .accent-green { color: var(--green); }

.hero-subtitle {
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.6;
  color: var(--white-80);
  max-width: 640px;
}

.hero-legal {
  font-style: italic;
  font-size: 13px;
  color: var(--white-60);
  max-width: 560px;
  line-height: 1.5;
}

.hero-cta {
  margin-top: 8px;
  padding: 16px 40px;
  border-radius: 12px;
  background: var(--red-cta);
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(232, 72, 85, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(232, 72, 85, 0.45); }
.hero-cta:active { transform: translateY(0); }

.dates-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.dates-row-top {
  display: flex;
  justify-content: center;
}

.date-ouverture {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 24px;
  border-radius: 12px;
  background: rgba(38, 208, 124, 0.12);
  border: 1px solid rgba(38, 208, 124, 0.3);
  text-align: center;
  cursor: default;
  transition: transform 0.2s ease, background 0.2s ease;
}

.date-ouverture:hover {
  transform: scale(1.08);
  background: rgba(38, 208, 124, 0.2);
}

.dates-connector {
  display: flex;
  align-items: center;
}

.connector-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 100%);
}

.connector-center {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #26D07C;
  opacity: 0.6;
  flex-shrink: 0;
}

.dates-row-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
}

.dates-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dates-col-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.col-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  justify-content: flex-end;
}

.niveau-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 900;
  background: linear-gradient(135deg, #E84855, #C0392B);
  color: #fff;
  box-shadow: 0 2px 10px rgba(232, 72, 85, 0.45);
}

.date-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: default;
  width: fit-content;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.date-item:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(38, 208, 124, 0.35);
}

.dates-col-right .date-item {
  align-self: flex-end;
  text-align: right;
}

.date-lbl {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.date-val {
  font-size: 14px;
  font-weight: 800;
  color: #26D07C;
}

.date-ouverture .date-val {
  font-size: 17px;
}

.col-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
  align-self: stretch;
}

/* ═══════════════════════════════════════════════════════
   3 ÉTAPES
════════════════════════════════════════════════════════ */
.steps-section {
  position: relative;
  padding: 70px 24px 90px;
}

.steps-grid {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 16px 16px 0 0;
  pointer-events: none;
}

.step-card::after {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  pointer-events: none;
}

.step-card-num {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--progress-gradient);
  font-weight: 700;
  font-size: 18px;
}

.step-card-icon {
  position: relative;
  z-index: 1;
  font-size: 34px;
  color: var(--white);
}

.step-card-label {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

.step-card-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  position: relative;
  z-index: 1;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   APP SHELL
════════════════════════════════════════════════════════ */
#app {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-progress-wrap {
  padding: 22px 24px 0;
}

.app-progress-bar {
  max-width: 720px;
  margin: 0 auto;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.app-progress-fill {
  height: 100%;
  width: 25%;
  border-radius: 999px;
  background: var(--progress-gradient);
  transition: width 0.4s ease;
}

.screens-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.screens-track {
  display: flex;
  width: 500%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.screen {
  width: 20%;
  overflow-y: auto;
  padding: 32px 24px 60px;
  display: flex;
  justify-content: center;
}

.screen-inner {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.screen-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.screen-header p {
  color: var(--white-80);
  font-size: 14px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   FORM ELEMENTS
════════════════════════════════════════════════════════ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--white-80);
}

.field-hint {
  font-size: 12px;
  color: var(--white-60);
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="date"],
.field select,
.field textarea {
  height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 15px;
}

.field textarea { height: auto; padding: 12px 16px; resize: vertical; }

.field input::placeholder { color: var(--white-60); }

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.25);
}

.field input:disabled, .field select:disabled {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white-60);
  border-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}

.field select option { color: #000; }
.field select option:disabled { color: #999; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.section-divider {
  height: 2px;
  border-radius: 2px;
  background: var(--progress-gradient);
  opacity: 0.4;
  margin: 8px 0;
}

.section-divider:has(.divider-line) {
  height: auto;
  background: none;
  opacity: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.divider-line {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--progress-gradient);
  opacity: 0.4;
}

.divider-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--white-80);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
}

.btn {
  height: 52px;
  padding: 0 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--cyan);
  color: var(--gradient-start);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-danger {
  background: var(--red-cta);
  color: var(--white);
  width: 100%;
}
.btn-danger:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(232, 72, 85, 0.4); }

.btn-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════
   ERROR / ALERT
════════════════════════════════════════════════════════ */
.error-box {
  background: var(--error-bg);
  border-left: 3px solid var(--red-cta);
  color: #7A1F26;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-box {
  background: var(--error-bg);
  border-left: 3px solid var(--red-cta);
  border-radius: 6px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: #7A1F26;
}

.alert-icon-square {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(232, 72, 85, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-cta);
  font-size: 20px;
}

.alert-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.alert-box p { font-size: 13px; line-height: 1.5; }

.info-box-green {
  background: rgba(38, 208, 124, 0.12);
  border-left: 3px solid var(--green);
  color: var(--white);
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   NIE INPUT / VERIFY
════════════════════════════════════════════════════════ */
.nie-input-row {
  display: flex;
  gap: 12px;
}
.nie-input-row input { flex: 1; }

/* ═══════════════════════════════════════════════════════
   DOCUMENTS
════════════════════════════════════════════════════════ */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.doc-item.has-file { border-color: var(--green); }

.doc-icon-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--cosmos-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 20px;
}

.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; font-size: 14px; }
.doc-filename { font-size: 12px; color: var(--green); margin-top: 2px; word-break: break-all; }

.doc-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.doc-badge.required { background: rgba(232, 72, 85, 0.2); color: #ffb3b8; }
.doc-badge.optional { background: rgba(0, 180, 216, 0.2); color: #8fe3f5; }
.doc-badge.free { background: rgba(255, 255, 255, 0.15); color: var(--white-80); }

.doc-choose-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.doc-item input[type="file"] { display: none; }

.doc-others-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.doc-others-list .doc-filename { font-size: 12px; }

/* ═══════════════════════════════════════════════════════
   SCREEN 4 — RECAP
════════════════════════════════════════════════════════ */
.recap-card {
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recap-nie-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--cosmos-gradient);
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
}

.recap-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--white-80);
}
.recap-row strong { color: var(--white); }

.date-lieu-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ═══════════════════════════════════════════════════════
   FIELD FEEDBACK (erreurs) + LECTURE SEULE
════════════════════════════════════════════════════════ */
.field-error {
  font-size: 12px;
  color: var(--red-cta);
}

.readonly-display {
  height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white-80);
  font-size: 15px;
  display: flex;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════
   SIGNATURE
════════════════════════════════════════════════════════ */
.signature-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.signature-header {
  background: var(--cosmos-gradient);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.signature-header span { font-weight: 600; font-size: 14px; }

.signature-clear-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
}

.signature-canvas-wrap {
  background: rgba(255, 255, 255, 0.95);
  position: relative;
}

#signature-canvas {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
}

.signature-line-label {
  text-align: center;
  font-size: 11px;
  color: var(--white-60);
  padding: 8px 0;
}

/* ═══════════════════════════════════════════════════════
   CHECKBOX
════════════════════════════════════════════════════════ */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--white-80);
}
.check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--cyan);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   SUCCESS SCREEN
════════════════════════════════════════════════════════ */
.success-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.success-inner {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--progress-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
}

.success-inner h2 { font-size: 24px; font-weight: 700; }
.success-inner p { color: var(--white-80); font-size: 14px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .steps-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .date-lieu-row { grid-template-columns: 1fr; }
  .btn { min-height: 52px; }
  .field input, .field select, .field textarea, .readonly-display { min-height: 48px; }
  .btn-row { flex-direction: column-reverse; }
  .screen { padding: 24px 18px 48px; }
}
