/* ==========================================
   RETRAITE À PIERRE — Main Styles
   ========================================== */

:root {
  --gold:      #c9a84c;
  --gold-light:#f0d080;
  --gold-dim:  rgba(201,168,76,0.15);
  --dark:      #1a1a2e;
  --dark-2:    #16213e;
  --accent:    #e94560;
  --text:      #2d2d2d;
  --text-light:#777;
  --bg:        #faf9f7;
  --card-bg:   #ffffff;
  --radius:    16px;
  --shadow:    0 4px 24px rgba(0,0,0,0.07);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.13);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   HERO
   ============================================================ */

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

/* Layered background: deep navy → indigo */
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #0f0c29 0%, #1a1a2e 40%, #0f3460 100%);
  z-index: 0;
}

/* Subtle gold cross-hatch pattern */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Vignette overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.5) 100%);
  z-index: 1;
}

/* Sparkle container */
.sparkles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  border-radius: 50%;
  background: var(--gold-light);
  opacity: 0;
  animation: twinkle var(--dur, 3s) var(--delay, 0s) ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0;          transform: scale(0.4); }
  50%       { opacity: var(--op); transform: scale(1.3); }
}

/* ---- Pierre photo frame ---- */
.pierre-frame {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 0 auto 36px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  z-index: 2;
}

/* Animated gold ring */
.pierre-frame::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(
    var(--gold) 0deg,
    var(--gold-light) 90deg,
    var(--gold) 180deg,
    var(--gold-light) 270deg,
    var(--gold) 360deg
  );
  animation: spin-ring 6s linear infinite;
  z-index: -1;
}

/* Inner fill to hide the ring behind the photo */
.pierre-frame::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  z-index: -1;
}

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

.pierre-initial {
  font-family: 'Playfair Display', serif;
  font-size: 4.5rem;
  font-style: italic;
  color: var(--gold);
  line-height: 1;
  user-select: none;
}

/* When real photo is available */
.pierre-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

/* ---- Hero content ---- */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 16px;
  font-weight: 500;
}

.hero-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  color: #fff;
  line-height: 1.1;
  margin-bottom: 24px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}

.divider-fancy {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin: 0 0 28px;
}
.divider-fancy span:not(.diamond) {
  display: block;
  height: 1px;
  width: 80px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}
.diamond { color: var(--gold); font-size: 0.7rem; }

.hero-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.80);
  line-height: 1.95;
  margin-bottom: 40px;
}
.hero-desc em { color: var(--gold-light); font-style: italic; }

/* ---- Scroll indicator ---- */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: bob 2.4s ease-in-out infinite;
  pointer-events: none;
}
.scroll-arrow { font-size: 1.1rem; margin-top: 4px; }

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--dark);
  padding: 16px 40px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 4px 24px rgba(201,168,76,0.45);
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(201,168,76,0.55);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--gold); color: var(--dark); }


/* ============================================================
   SECTION TITLES
   ============================================================ */

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--dark);
  text-align: center;
  margin-bottom: 8px;
}
.section-sub {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 52px;
  font-size: 1rem;
}


/* ============================================================
   MESSAGES SECTION
   ============================================================ */

.messages-section {
  padding: 90px 0;
  background: var(--bg);
}

.messages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
}

/* ---- Message card ---- */
.message-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--gold);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.message-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Giant decorative quote mark */
.message-card::before {
  content: '\201C';
  font-family: 'Playfair Display', serif;
  font-size: 7rem;
  color: var(--gold);
  opacity: 0.10;
  position: absolute;
  top: -16px;
  left: 12px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.message-author {
  font-weight: 700;
  color: var(--dark);
  font-size: 1.02rem;
  margin-bottom: 4px;
}
.message-date {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.message-text {
  color: var(--text);
  line-height: 1.75;
  font-size: 0.96rem;
  white-space: pre-line;
}

.message-media {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.message-media img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.message-media img:hover { opacity: 0.88; }
.message-media video {
  width: 100%;
  border-radius: 10px;
  max-height: 220px;
}

/* ---- Loading dots ---- */
.loading-messages {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 60px 0;
}
.loading-dots { display: flex; gap: 10px; align-items: center; }
.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1.2); }
}

.empty-messages {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-size: 1rem;
}


/* ============================================================
   FORM SECTION
   ============================================================ */

.form-section {
  padding: 90px 0;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border-top: 1px solid #ece9e3;
}

.message-form {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  max-width: 640px;
  margin: 0 auto;
}

/* ---- OTP steps ---- */
.otp-step-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: #f8f7f4;
  border-radius: 12px;
}
.otp-step-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0ddd6;
  color: #888;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.otp-step-badge.active {
  background: var(--gold);
  color: var(--dark);
}
.otp-step-header strong { display: block; color: var(--dark); margin-bottom: 2px; }
.otp-step-hint { font-size: 0.85rem; color: var(--text-light); margin: 0; }

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

.form-group { margin-bottom: 24px; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--dark);
  letter-spacing: 0.02em;
}
.required { color: var(--accent); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e8e4dc;
  border-radius: 10px;
  font-size: 0.97rem;
  font-family: inherit;
  color: var(--text);
  background: #fafaf8;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.12);
  background: #fff;
}

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

.char-count {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
  transition: color 0.2s;
}
.char-count.near-limit { color: var(--accent); }

/* ---- Upload zone ---- */
.upload-zone {
  border: 2px dashed #d5d0c6;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-dim);
}
.upload-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.upload-zone p { color: var(--text-light); margin-bottom: 4px; }
.upload-zone small { color: #bbb; font-size: 0.8rem; }
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  border: none;
  padding: 0;
}

.upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.upload-preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
  box-shadow: var(--shadow);
}
.upload-preview-item img,
.upload-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.remove-preview {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-submit {
  width: 100%;
  padding: 18px;
  font-size: 1.05rem;
  margin-top: 8px;
}

.form-success {
  display: none;
  margin-top: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border-radius: 12px;
  color: #2e7d32;
  font-weight: 600;
  text-align: center;
  font-size: 1.05rem;
  border: 1px solid #c8e6c9;
}
.form-error {
  display: none;
  margin-top: 16px;
  padding: 14px 20px;
  background: #fce4e4;
  border-radius: 10px;
  color: #c62828;
  font-size: 0.9rem;
}


/* ============================================================
   AI ASSIST
   ============================================================ */

.ai-assist-box {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(201,168,76,0.3);
}
.ai-assist-label {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}
.ai-assist-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.ai-relation-select {
  flex: 1;
  min-width: 160px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
}
.ai-relation-select option { background: #1a1a2e; color: #fff; }

.btn-ai {
  background: var(--gold);
  color: var(--dark);
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-ai:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-ai--secondary {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid rgba(201,168,76,0.5);
}
.btn-ai--secondary:hover { background: rgba(201,168,76,0.15); transform: translateY(-1px); }

.ai-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.86rem;
}
.ai-status--loading { background: rgba(255,255,255,0.06); color: var(--gold-light); }
.ai-status--success { background: rgba(76,175,80,0.2);   color: #a5d6a7; }
.ai-status--error   { background: rgba(233,69,96,0.2);   color: #ef9a9a; }
.ai-status--warning { background: rgba(255,152,0,0.2);   color: #ffcc80; }

.video-link {
  display: inline-block;
  margin-top: 8px;
  background: var(--dark);
  color: var(--gold-light);
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.2s;
}
.video-link:hover { background: #0f3460; }


/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2, #16213e) 100%);
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 56px 24px;
}
.footer-inner { max-width: 400px; margin: 0 auto; }
.footer-main {
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.footer strong { color: var(--gold-light); }
.footer-sub { font-size: 0.85rem; color: rgba(255,255,255,0.35); }


/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
  animation: lb-in 0.25s ease;
}
@keyframes lb-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  color: rgba(255,255,255,0.7);
  font-size: 2.2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  transition: color 0.2s;
}
.lightbox-close:hover { color: #fff; }


/* ============================================================
   SCROLL REVEAL
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   CONFETTI
   ============================================================ */

#confetti-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confetti-fall var(--dur) var(--delay) ease-in forwards;
  opacity: 1;
}

@keyframes confetti-fall {
  0%   { top: -20px; opacity: 1; transform: rotate(0deg) translateX(0); }
  80%  { opacity: 1; }
  100% { top: 110vh;  opacity: 0; transform: rotate(var(--rot)) translateX(var(--drift)); }
}


/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .message-form { padding: 28px 20px; }
  .messages-grid { grid-template-columns: 1fr; }
  .ai-assist-row { flex-direction: column; }
  .ai-relation-select { width: 100%; }
  .btn-ai { width: 100%; justify-content: center; }
  .pierre-frame { width: 110px; height: 110px; margin-bottom: 28px; }
  .pierre-initial { font-size: 3.5rem; }
  .hero { padding: 60px 20px 90px; }
}
/* Share consent */
.share-consent { margin-bottom: 8px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #444;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #c9a84c;
  cursor: pointer;
  flex-shrink: 0;
}
.share-hint {
  margin: 4px 0 0 28px;
  font-size: 0.8rem;
  color: #aaa;
}

/* Edit mode */
.edit-notice {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-left: 4px solid #c9a84c;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: #7a5f1a;
}
.message-form.is-editing {
  border-top: 3px solid #c9a84c;
}

/* Médias existants */
.existing-media {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.existing-media-item img {
  height: 90px;
  width: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
}
.existing-media-item.video-item {
  height: 90px;
  width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  font-size: 0.85rem;
  text-align: center;
}
.existing-media-item.video-item a {
  color: #555;
  text-decoration: none;
}

/* OTP method toggle */
.otp-method-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.method-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  color: #888;
  transition: all 0.2s;
}
.method-btn.active {
  border-color: var(--gold, #c9a84c);
  color: var(--gold, #c9a84c);
  background: rgba(201,168,76,0.06);
  font-weight: 600;
}
