* { box-sizing: border-box; }

:root {
  --navy: #111c2c;
  --navy-light: #1b2c42;
  --gold: #c9a84c;
  --gold-light: #ddc57a;
  --cream: #f5edd8;
  --ink: #1c1c1c;
  --muted: #6b6458;
}

body {
  margin: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #f5f1e8 0%, #efe9db 100%);
  color: var(--ink);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

/* --- En-tête / identité de marque --- */

.brand-header {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-light) 100%);
  margin: 0 -20px 24px;
  padding: 32px 20px 26px;
  border-radius: 0 0 22px 22px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(17, 28, 44, 0.3);
}

.brand-logo {
  display: block;
  width: 180px;
  max-width: 60%;
  margin: 0 auto 8px;
}

.brand-header h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--cream);
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(201, 168, 76, 0.3);
}

.brand-footer {
  text-align: center;
  margin-top: 32px;
}

.brand-footer p {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
}

/* --- Étapes du parcours --- */

.step { display: flex; flex-direction: column; gap: 14px; }
.step[hidden] { display: none; }

.photo-input, .text-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  background: #fff;
  border: 1px solid #e7e1d2;
  border-radius: 8px;
  padding: 12px 14px;
}

.photo-input input[type="file"] {
  font-size: 13px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
}

.preview {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
}

input[type="text"], input[type="email"], input[type="tel"], textarea {
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  width: 100%;
}

textarea { min-height: 70px; resize: vertical; }

button {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 16px;
  border-radius: 8px;
  border: none;
  background: #000;
  color: var(--cream);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active { transform: translateY(1px); }

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary {
  background: transparent;
  color: var(--navy);
  border: 1px solid #ccc;
  box-shadow: none;
}

.button-link {
  display: block;
  text-align: center;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 16px;
  border-radius: 8px;
  background: #000;
  color: var(--cream);
}

.button-link.secondary {
  background: transparent;
  color: var(--navy);
  border: 1px solid #ccc;
}

.error { color: #b3261e; font-size: 13px; }

.hint { font-size: 13px; color: var(--muted); margin: 0; }

.success-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--navy);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e7e1d2;
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 20px auto 0;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#step-loading { align-items: center; text-align: center; padding: 40px 0; }

.report-section {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #ddd;
}

.link-button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  padding: 0;
  cursor: pointer;
  box-shadow: none;
}

#report-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#report-message { min-height: 60px; }


/* --- Mes cartes scannées : vignettes cliquables --- */
.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 4px 0 20px;
}
.record-card {
  background: #fff;
  border: 1px solid rgba(17, 28, 44, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(17, 28, 44, 0.08);
  cursor: default;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.record-card:hover,
.record-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 28, 44, 0.14);
}
.record-card-photo {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  background: var(--cream);
}
.record-card-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--gold);
  background: var(--cream);
}
.record-card-body {
  padding: 12px 14px 14px;
}
.record-card-name {
  margin: 0 0 2px;
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
}
.record-card-company {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.record-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.record-card-link {
  font-size: 13px;
  color: var(--navy);
  text-decoration: none;
  word-break: break-all;
}
.record-card-link:hover {
  color: var(--gold);
  text-decoration: underline;
}
.record-card-date {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}


/* --- Mes fiches scannées : titre, recherche, vignettes enrichies --- */
.records-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 17px;
  margin: 0 0 10px;
  text-align: center;
}
.search-input {
  margin-bottom: 14px;
}
.record-card-meta {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.record-card-more {
  display: block;
  margin-top: 8px;
  margin-left: auto;
  background: none;
  border: none;
  padding: 0;
  color: var(--gold);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: right;
  width: 100%;
}
.record-card-more:hover {
  text-decoration: underline;
}

/* --- Fiche détaillée --- */
.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.detail-photos {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.detail-photo {
  width: 50%;
  max-width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--cream);
}
.detail-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--gold);
}
.detail-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 17px;
  margin: 0 0 10px;
}
.detail-row {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink);
}
.detail-row strong {
  color: var(--navy);
}
.detail-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}
.detail-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.detail-edit-actions button {
  flex: 1;
}


/* --- Mes fiches scannées : bouton CSV en haut + filtres --- */
.csv-btn {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  background: var(--navy);
  color: var(--gold-light);
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.csv-btn:hover {
  background: var(--navy-light);
}
.filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}
.filter-input {
  width: 100%;
  border: 1px solid rgba(17, 28, 44, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  box-sizing: border-box;
}
.filter-input:focus {
  outline: none;
  border-color: var(--gold);
}
.filter-input::placeholder {
  color: var(--muted);
}


/* --- Images entières + carrousel recto/verso glissable (fiche détaillée) --- */
.record-card-photo {
  object-fit: contain;
  background: var(--cream);
}
.detail-photo-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  background: var(--cream);
  margin: 0 0 8px;
  scrollbar-width: none;
}
.detail-photo-carousel::-webkit-scrollbar {
  display: none;
}
.detail-photo-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
}
.detail-photo-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.detail-photo-slide.detail-photo-placeholder {
  font-size: 44px;
  color: var(--gold);
}
.detail-photo-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0 0 14px;
}
.detail-photo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(17, 28, 44, 0.2);
  transition: background 0.15s ease;
}
.detail-photo-dot.active {
  background: var(--gold);
}

/* --- Bandeau de renouvellement (abonnement < 30 jours) --- */
.renewal-banner {
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid rgba(201, 168, 76, 0.4);
  color: var(--navy);
  font-size: 13px;
}
.renewal-banner .link-button {
  color: var(--navy);
  font-weight: 700;
}

/* --- Espace administrateur --- */
.admin-block {
  background: #fff;
  border: 1px solid #e7e1d2;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-block input[type="number"] {
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  width: 100%;
}
.admin-block select {
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  width: 100%;
  background: #fff;
}

/* --- Choix de forfait (écran NEEDS_ACCESS) --- */
.tier-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tier-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: #fff;
  border: 1px solid #e7e1d2;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: left;
  box-shadow: none;
  color: var(--ink);
}
.tier-card:hover,
.tier-card:focus-visible {
  border-color: var(--gold);
}
.tier-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
}
.tier-price {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--gold);
}
.tier-quota {
  font-size: 12px;
  color: var(--muted);
}
