:root {
  color-scheme: light dark;
  /* CC Albères Côte Vermeille Illibéris brand colors, taken from cc-acvi.com */
  --accent: #0373bc;
  --accent-dark: #025a94;
  --accent-2: #db0083;
  --text: #111827;
  --muted: #6b7280;
  --card-bg: rgba(255, 255, 255, 0.9);
  --field-bg: rgba(255, 255, 255, 0.65);
  --field-border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: -5%;
  background-image: var(--bg-image, url("/static/background.svg"));
  background-size: cover;
  background-position: center;
  filter: blur(6px);
  transform: scale(1.08);
  z-index: -1;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 1.25rem;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
}

.card-wide {
  max-width: 640px;
}

.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.brand-logo {
  height: 200px;
  width: auto;
  background: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 0.75rem;
}

.page-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.page-footer a {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
}

.page-footer a:hover {
  color: var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  padding: 0.65rem 1rem;
  border: 2px solid var(--field-border);
  border-radius: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.back-link:hover {
  border-color: var(--accent);
  background: rgba(3, 115, 188, 0.08);
}

.cgu-content h2 {
  font-size: 1.15rem;
  color: var(--accent);
  margin: 1.5rem 0 0.5rem;
}

.cgu-content h2:first-child {
  margin-top: 0;
}

.cgu-content p {
  margin: 0 0 0.85rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.cgu-content ul,
.cgu-content ol {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.cgu-content a {
  color: var(--accent);
}

h1 {
  font-size: 2.2rem;
  margin: 0;
  text-align: center;
  color: var(--accent);
}

.subtitle {
  margin: 0.25rem 0 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Native file input stays in the DOM (and keeps its `capture` behavior on
   phones) but is visually replaced by the label styled below. */
.photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.photo-picker {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border: 2px dashed #cbd5e1;
  border-radius: 0.9rem;
  background: var(--field-bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.photo-picker:active,
.photo-input:focus-visible + .photo-picker,
.photo-picker:has(+ .photo-input:focus-visible) {
  border-color: var(--accent);
}

.photo-picker-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(3, 115, 188, 0.12);
  color: var(--accent);
}

.photo-picker-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.25;
}

.photo-picker-text small {
  color: var(--muted);
}

.photo-picker-preview {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: 0.6rem;
  object-fit: cover;
  flex: none;
}

.photo-picker.has-image .photo-picker-icon {
  display: none;
}

.photo-picker.has-image .photo-picker-preview {
  display: block;
}

.photo-picker.has-image .photo-picker-text strong::after {
  content: " ✓";
  color: var(--accent-2);
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.text-input {
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--field-border);
  border-radius: 0.75rem;
  font-size: 1rem;
  background: var(--field-bg);
  color: var(--text);
  margin-bottom: 0.5rem;
}

.text-input:focus {
  border-color: var(--accent);
  outline: none;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.5rem;
  padding: 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:active {
  background: var(--accent-dark);
}

.banner {
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 1rem;
}

.banner-error {
  background: rgba(219, 0, 131, 0.12);
  color: var(--accent-2);
}

.project-info {
  margin-top: 0.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--field-border);
}

.project-info h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  text-align: center;
  color: var(--text);
}

.project-video {
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
}

.project-video video {
  display: block;
  width: 100%;
  height: auto;
}

.project-text {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f3f4f6;
    --muted: #9ca3af;
    --card-bg: rgba(15, 20, 32, 0.85);
    --field-bg: rgba(15, 20, 32, 0.6);
    --field-border: #2a3140;
  }

  .card {
    border-color: rgba(255, 255, 255, 0.08);
  }

  h1 {
    color: #6cb6e8;
  }

  .photo-picker {
    border-color: #3a4356;
  }

  .banner {
    background: rgba(20, 83, 45, 0.85);
    color: #bbf7d0;
  }
}
