/* ===========================================================
   CEI/REC/ITURI — Design system (vanilla CSS)
   Theme: clair, "bleu de nuit", premium
   =========================================================== */

:root {
  --background: #f5f7fb;
  --foreground: #0f1733;
  --card: #ffffff;
  --muted: #f1f4f9;
  --muted-foreground: #5b6478;
  --border: #e3e8f1;
  --input-border: #d8dfeb;

  --primary: #1a2452;
  --primary-deep: #0f1733;
  --primary-glow: #3b4d9c;
  --primary-foreground: #ffffff;

  --accent: #e7ecf8;
  --warning: #f59e0b;
  --warning-bg: #fef6e4;
  --danger: #dc2626;
  --danger-bg: #fdeaea;
  --success: #10b981;
  --success-bg: #e6f8f1;

  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-soft: 0 4px 20px -4px rgba(26, 36, 82, 0.10);
  --shadow-elegant: 0 20px 60px -20px rgba(26, 36, 82, 0.25);
  --shadow-glow: 0 0 40px rgba(59, 77, 156, 0.35);

  --gradient-primary: linear-gradient(135deg, #0f1733 0%, #2a3a78 100%);
  --gradient-soft: linear-gradient(180deg, #f5f7fb 0%, #e9eef8 100%);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--gradient-soft);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--primary-deep);
}

/* ----- Background decor ----- */
.bg-decor {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
}
.blob {
  position: absolute; width: 24rem; height: 24rem; border-radius: 9999px;
  filter: blur(80px); opacity: 0.35; animation: float 8s ease-in-out infinite;
}
.blob-1 { top: -8rem; right: -8rem; background: var(--primary-glow); }
.blob-2 { bottom: -8rem; left: -8rem; background: var(--primary); opacity: 0.25; animation-delay: 2s; }
.blob-success { top: -8rem; right: -8rem; background: var(--success); opacity: 0.25; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

/* ----- Container ----- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ----- Brand header ----- */
.brand-header {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 2.5rem 1rem 2rem;
  animation: fade-down 0.6s ease-out;
}
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
.logo-wrap { position: relative; margin-bottom: 1.25rem; }
.logo-glow {
  position: absolute; inset: 0; background: var(--gradient-primary);
  border-radius: 1rem; filter: blur(20px); opacity: 0.3;
}
.logo-box {
  position: relative; background: var(--gradient-primary);
  border-radius: 1rem; padding: 0.75rem; box-shadow: var(--shadow-elegant);
  transition: transform 0.3s ease;
}
.logo-box:hover { transform: scale(1.05) rotate(-3deg); }
.logo-box img { display: block; width: 64px; height: 64px; object-fit: contain; }

.brand-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 800;
}
.subtitle {
  margin: 0.5rem 0 0; font-size: 1rem; font-weight: 500;
  color: var(--muted-foreground);
}
.date-pill {
  margin-top: 0.75rem; display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: 9999px;
  background: var(--accent); border: 1px solid var(--border);
  color: var(--primary-deep); font-size: 0.875rem; font-weight: 500;
}

/* ----- Card ----- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elegant);
  padding: 2rem;
  animation: fade-up 0.6s ease-out 0.1s both;
}
.success-card { padding: 3rem 2rem; text-align: center; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro {
  margin: 0 0 1.5rem; color: var(--muted-foreground);
  font-size: 0.95rem; line-height: 1.65;
}
.intro strong { color: var(--foreground); font-weight: 600; }

/* ----- Form grid ----- */
.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 0.875rem; font-weight: 600; color: var(--foreground);
}
.field input, .field select {
  font: inherit; font-size: 0.95rem; color: var(--foreground);
  background: #fff; border: 1.5px solid var(--input-border);
  border-radius: var(--radius); padding: 0.7rem 0.9rem;
  transition: all 0.2s ease; outline: none; width: 100%;
}
.field select { appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6478' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 0.9rem center;
  padding-right: 2.25rem; cursor: pointer;
}
.field input::placeholder { color: #9aa3b8; }
.field input:hover, .field select:hover { border-color: var(--primary-glow); }
.field input:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 77, 156, 0.15);
}

/* ----- Buttons ----- */
.btn-primary {
  margin-top: 1.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; width: 100%;
  padding: 0.9rem 1.5rem;
  font: inherit; font-weight: 600; font-size: 1rem;
  color: var(--primary-foreground); background: var(--gradient-primary);
  border: none; border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  cursor: pointer; transition: all 0.3s ease;
  text-decoration: none;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-glow);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-arrow { transition: transform 0.2s ease; }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.9rem 1.5rem; font-weight: 600;
  background: var(--card); color: var(--foreground);
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; transition: all 0.2s ease;
}
.btn-ghost:hover { background: var(--accent); }

/* Spinner */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Alert ----- */
.alert {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem; border-radius: var(--radius);
  border: 1px solid; margin-bottom: 1.25rem;
  animation: alert-in 0.25s ease-out;
}
@keyframes alert-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.alert-warning { background: var(--warning-bg); border-color: rgba(245, 158, 11, 0.4); }
.alert-warning .alert-icon { background: rgba(245, 158, 11, 0.2); color: #92590b; }
.alert-danger { background: var(--danger-bg); border-color: rgba(220, 38, 38, 0.4); }
.alert-danger .alert-icon { background: rgba(220, 38, 38, 0.2); color: var(--danger); }
.alert-success { background: var(--success-bg); border-color: rgba(16, 185, 129, 0.4); }
.alert-success .alert-icon { background: rgba(16, 185, 129, 0.2); color: var(--success); }

.alert-icon {
  flex-shrink: 0; padding: 0.5rem; border-radius: 0.5rem;
  display: inline-flex;
}
.alert-body { flex: 1; min-width: 0; }
.alert-title { margin: 0; font-weight: 600; font-size: 0.9rem; color: var(--foreground); }
.alert-msg { margin: 0.15rem 0 0; font-size: 0.875rem; color: var(--muted-foreground); }
.alert-close {
  background: none; border: none; cursor: pointer; font-size: 1.5rem;
  line-height: 1; color: var(--muted-foreground); padding: 0; width: 24px; height: 24px;
}
.alert-close:hover { color: var(--foreground); }

/* ----- Success ----- */
.check-wrap { position: relative; margin: 0 auto 1.5rem; width: 6rem; height: 6rem;
  animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both; }
@keyframes bounce-in {
  0% { opacity: 0; transform: scale(0) rotate(-180deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.check-glow {
  position: absolute; inset: 0; background: var(--success);
  border-radius: 9999px; filter: blur(20px); opacity: 0.3;
}
.check-circle {
  position: relative; width: 100%; height: 100%;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  border: 4px solid rgba(16, 185, 129, 0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--success);
}
.check-path {
  stroke-dasharray: 30; stroke-dashoffset: 30;
  animation: draw 0.6s ease-out 0.5s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.success-card h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem); font-weight: 800;
  animation: fade-up 0.5s ease-out 0.6s both;
}
.success-card > p {
  margin-top: 0.75rem; color: var(--muted-foreground);
  text-wrap: balance;
  animation: fade-up 0.5s ease-out 0.7s both;
}
.success-card > p strong { color: var(--foreground); }

.actions {
  margin-top: 2rem; display: flex; gap: 0.75rem; justify-content: center;
  flex-wrap: wrap;
  animation: fade-up 0.5s ease-out 0.85s both;
}
.actions .btn-primary, .actions .btn-ghost { width: auto; margin-top: 0; }

/* ----- Footer ----- */
.support {
  margin: 2.5rem 0 1.5rem; text-align: center; padding: 0 1rem;
  font-size: 0.875rem; color: var(--muted-foreground);
}
.wa-btn {
  margin-top: 0.5rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1); color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3); font-weight: 600;
  text-decoration: none; transition: all 0.2s ease;
}
.wa-btn:hover { background: rgba(16, 185, 129, 0.2); transform: scale(1.05); }

/* ----- Responsive ----- */
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .card { padding: 1.5rem; border-radius: var(--radius-lg); }
  .success-card { padding: 2rem 1.25rem; }
}

/* ----- Accessibility ----- */
:focus-visible {
  outline: 3px solid var(--primary-glow);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
