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

:root {
  --green: #22c55e;
  --green-dark: #16a34a;
  --green-light: #dcfce7;
  --green-glow: rgba(34, 197, 94, 0.35);
  --bg: #ffffff;
  --card: #ffffff;
  --text: #14532d;
  --muted: #4b7a5c;
  --error: #dc2626;
  --radius: 14px;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(160deg, #ffffff 0%, #ecfdf5 45%, #bbf7d0 100%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.page {
  width: 100%;
  max-width: 480px;
}

.banner {
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.2);
}

.banner-img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.card {
  background: var(--card);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: 0 12px 32px rgba(22, 163, 74, 0.12);
  min-height: 260px;
  position: relative;
}

.phase {
  display: none;
  animation: fadeIn 0.45s ease;
}

.phase.active {
  display: block;
}

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

/* Chargement vert — rond animé */
#phase-load {
  text-align: center;
}

.load-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border: 4px solid var(--green-light);
  border-top-color: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--green-glow);
  animation: loadSpin 0.85s linear infinite;
}

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

.load-label {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--green);
}

.load-hint {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Captcha */
h1 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

#honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  pointer-events: none;
}

.question-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--green-light);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.question {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.equals {
  font-size: 1.5rem;
  color: var(--muted);
}

#answer {
  width: 80px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  padding: 0.4rem 0.5rem;
  border: 2px solid rgba(34, 197, 94, 0.35);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

#answer:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

#answer::-webkit-outer-spin-button,
#answer::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.error {
  color: var(--error);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  min-height: 1.25rem;
}

button[type="submit"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--green-glow);
}

button[type="submit"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Succès */
.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px var(--green-glow);
}

#phase-success h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

#phase-success p {
  text-align: center;
  color: var(--muted);
}

.footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}
