/* style.css · collecte-identite */

:root {
  --cream: #FAF7F2;
  --ink: #111111;
  --teal: #2456D6;
  --teal-dark: #1B41A8;
  --muted: #6b6b66;
  --line: #e7e2d9;
  --white: #ffffff;
  --warn: #a86717;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17,17,17,0.04), 0 12px 32px rgba(17,17,17,0.07);
  --font: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 32px 32px;
  overflow: hidden;
}

.accent-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--teal);
}

h1 {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 12px 0 8px;
}

.muted { color: var(--muted); margin: 0; }
.intro { margin-bottom: 22px; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: rgba(36,86,214,0.09);
  padding: 5px 10px;
  border-radius: 999px;
}
.badge-warn { color: var(--warn); background: rgba(168,103,23,0.1); }

/* Fields */
.field { margin-bottom: 18px; display: flex; flex-direction: column; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label { font-size: 0.9rem; font-weight: 500; margin-bottom: 7px; }

input[type="text"],
input[type="date"] {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}
input[type="text"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(36,86,214,0.14);
}

.hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

/* Uploads */
.uploads { border: none; padding: 0; margin: 4px 0 20px; }
.uploads legend {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0;
  margin-bottom: 10px;
}

.dropzone {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 15px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  background: var(--cream);
  transition: border-color 140ms ease-out, background 140ms ease-out, transform 120ms ease-out;
}
.dropzone:last-child { margin-bottom: 0; }
.dropzone .dz-icon { color: var(--teal); flex-shrink: 0; }
.dz-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dz-title { font-size: 0.94rem; font-weight: 500; }
.dz-name {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dz-check {
  flex-shrink: 0;
  color: var(--teal);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}
.dropzone.filled {
  border-style: solid;
  border-color: var(--teal);
  background: rgba(36,86,214,0.05);
}
.dropzone.filled .dz-check { opacity: 1; transform: scale(1); }
.dropzone.filled .dz-name { color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .dropzone:hover { border-color: var(--teal); }
}

/* Consent */
.consent {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--muted);
  margin: 4px 0 22px;
  cursor: pointer;
  line-height: 1.5;
}
.consent input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--teal); flex-shrink: 0; }

/* Progress */
.progress {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--teal);
  border-radius: 999px;
  transition: width 300ms ease-out;
}

/* Error */
.error {
  font-size: 0.88rem;
  color: var(--danger);
  background: rgba(192,57,43,0.07);
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: 10px;
  padding: 10px 13px;
  margin: 0 0 16px;
}

/* Button */
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  background: var(--teal);
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  width: 100%;
  cursor: pointer;
  transition: filter 140ms ease-out, transform 120ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.06); }
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: default; }

/* Spinner */
.spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  margin: 8px auto 14px;
  animation: spin 0.8s linear infinite;
}
#loadingState { text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Success */
#doneState, #invalidState { text-align: center; }
.success-mark {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(36,86,214,0.12);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 16px;
}

.hidden { display: none !important; }

@media (max-width: 480px) {
  .card { padding: 28px 20px 26px; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  h1 { font-size: 1.4rem; }
}

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

/* ===== Liquid glass platform (mode clair, creme/bleu) ===== */
body.glass-page {
  min-height: 100dvh;
  background: var(--cream);
  position: relative;
  overflow-x: hidden;
}
/* halos bleus derriere le verre : donnent de la matiere a refracter */
body.glass-page::before,
body.glass-page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
}
body.glass-page::before {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(36,86,214,0.34), transparent 70%);
  top: -90px; right: -70px;
}
body.glass-page::after {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(36,86,214,0.16), transparent 70%);
  bottom: -140px; left: -90px;
}

.glass-wrap {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
}

.glass {
  position: relative;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 1px 2px rgba(17,17,17,0.04),
    0 16px 48px rgba(17,17,17,0.10);
  border-radius: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 30px 28px 28px;
}

.brand { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(36,86,214,0.15);
}
.brand-name {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
}

.tabs {
  display: flex; gap: 4px;
  background: rgba(17,17,17,0.05);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}
.tab {
  flex: 1; border: none; background: transparent;
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--muted);
  padding: 9px 12px; border-radius: 999px; cursor: pointer;
  transition: color 140ms ease-out, background 140ms ease-out, box-shadow 140ms ease-out;
}
.tab.active {
  background: var(--white); color: var(--ink);
  box-shadow: 0 1px 3px rgba(17,17,17,0.1);
}

input[type="email"],
input[type="password"] {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px; width: 100%;
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(36,86,214,0.14);
}

.message { font-size: 0.86rem; border-radius: 10px; padding: 10px 13px; margin: 0 0 14px; }
.error-msg { color: var(--danger); background: rgba(192,57,43,0.07); border: 1px solid rgba(192,57,43,0.2); }
.ok-msg { color: var(--teal-dark); background: rgba(36,86,214,0.08); border: 1px solid rgba(36,86,214,0.25); }

.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
  margin-top: 12px;
}
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover { background: rgba(17,17,17,0.04); filter: none; }
}

@media (max-width: 480px) {
  .auth-card { padding: 26px 20px 24px; }
}

/* ===== Dashboard large + galerie admin ===== */
.auth-card--wide { max-width: 520px; }
a.btn { display: block; }

.admin-wrap {
  position: relative; z-index: 1;
  max-width: 1040px; margin: 0 auto;
  padding: 22px 20px 60px;
}
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; width: auto; }

.gallery-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.gallery-head h1 { margin: 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.depot-card { padding: 16px; }
.depot-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.depot-head strong { font-size: 1rem; }
.depot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.depot-cell {
  aspect-ratio: 3 / 4;
  border-radius: 10px; overflow: hidden;
  background: rgba(17,17,17,0.05);
  display: flex; align-items: center; justify-content: center;
}
.depot-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdf-link {
  font-size: 0.82rem; font-weight: 700; color: var(--teal-dark);
  text-decoration: none; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--white);
}
.small { font-size: 0.78rem; }

/* ===== Password eye ===== */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 44px; }
.pwd-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); padding: 6px; display: flex; border-radius: 8px;
}
@media (hover: hover) and (pointer: fine) { .pwd-toggle:hover { color: var(--ink); } }

/* ===== Doc rows (dashboard) + lien voir ===== */
.doc-row { margin-bottom: 12px; }
.doc-row .dropzone { margin-bottom: 0; }
.dz-view {
  display: inline-block; margin: 6px 0 0 2px;
  font-size: 0.82rem; color: var(--teal-dark); text-decoration: none;
}
.dz-view:hover { text-decoration: underline; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; margin-top: 0; }

/* ===== Admin : statut + historique ===== */
.depot-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge-status {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 2px 9px; border-radius: 999px; text-transform: uppercase;
}
.st-complet { color: var(--teal-dark); background: rgba(36,86,214,0.12); }
.st-brouillon { color: var(--warn); background: rgba(168,103,23,0.12); }

.depot-history { margin-top: 12px; }
.depot-history summary {
  cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--muted); list-style: none;
}
.depot-history summary::-webkit-details-marker { display: none; }
.depot-history summary:hover { color: var(--ink); }
.history-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.history-item { display: flex; align-items: center; gap: 8px; }
.linkish {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--teal-dark); text-decoration: underline; font-family: inherit;
}

/* ===== Petite roue de chargement sur les boutons ===== */
.btn-spin {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: -3px;
  animation: spin 0.7s linear infinite;
}
.btn-ghost .btn-spin { border: 2px solid rgba(17,17,17,0.2); border-top-color: var(--ink); }

/* ===== Fleche retour (admin -> depot) ===== */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 600;
  padding: 8px 14px 8px 10px; border-radius: 999px;
  transition: color 140ms ease-out, background 140ms ease-out;
}
.back-link svg { color: var(--teal); }
@media (hover: hover) and (pointer: fine) {
  .back-link:hover { color: var(--ink); background: rgba(17,17,17,0.04); }
}
