/*
  De Doorbraak Code - Stylesheet
  Visuele richting: zwart fond, ingetogen, ruim, felroze als spaarzaam accent
  Typografie: Poppins overal
*/

/* ==========================================================================
   Reset & basis
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  color: #ffffff;
  background-color: #000000;
  min-height: 100vh;
  /* Subtiele achtergrond-textuur via radial gradient — heel licht */
  background-image: radial-gradient(
    ellipse at 50% 20%,
    rgba(238, 43, 82, 0.04) 0%,
    transparent 60%
  );
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

@media (min-width: 768px) {
  .container {
    padding: 64px 32px 120px;
  }
}

/* Logo */
.header {
  text-align: center;
  margin-bottom: 64px;
}

.logo {
  display: inline-block;
  width: 100%;
  max-width: 280px;
  height: auto;
}

@media (min-width: 768px) {
  .logo {
    max-width: 320px;
  }
}

/* ==========================================================================
   Sections (drie stappen: inleiding, formulier, output)
   ========================================================================== */

.section {
  display: none;
  animation: fadeIn 0.6s ease-out;
}

.section--active {
  display: block;
}

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

/* ==========================================================================
   Typografie
   ========================================================================== */

.day-marker {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ee2b52;
  margin: 0 0 32px;
}

.prose {
  font-size: 17px;
  line-height: 1.8;
}

.prose p {
  margin: 0 0 24px;
}

.prose .lead {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 32px;
}

.prose .emphasis {
  font-weight: 500;
  font-size: 19px;
}

@media (min-width: 768px) {
  .prose {
    font-size: 18px;
  }
  .prose .lead {
    font-size: 26px;
  }
  .prose .emphasis {
    font-size: 20px;
  }
}

/* ==========================================================================
   Knoppen
   ========================================================================== */

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  padding: 16px 36px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease,
    color 0.2s ease;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-align: center;
  margin-top: 32px;
}

.btn--primary {
  background-color: #ee2b52;
  color: #ffffff;
}

.btn--primary:hover {
  background-color: #ffffff;
  color: #000000;
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--secondary {
  background-color: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn--secondary:hover {
  border-color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Formulier
   ========================================================================== */

.form {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.field {
  display: flex;
  flex-direction: column;
}

.label {
  display: block;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 12px;
  color: #ffffff;
}

.hint {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 16px;
  font-style: italic;
  line-height: 1.6;
}

.input,
.textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: #ffffff;
  background-color: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding: 12px 0;
  transition: border-color 0.2s ease;
  resize: vertical;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-bottom-color: #ee2b52;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.textarea {
  min-height: 120px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 16px;
  margin-top: 4px;
}

.textarea:focus {
  border-color: #ee2b52;
}

/* Checkbox grid voor de gebieden */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}

@media (min-width: 600px) {
  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  font-size: 15px;
  user-select: none;
}

.checkbox:hover {
  border-color: rgba(238, 43, 82, 0.6);
  background-color: rgba(238, 43, 82, 0.04);
}

.checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  background-color: transparent;
}

.checkbox input[type="checkbox"]:checked {
  background-color: #ee2b52;
  border-color: #ee2b52;
}

.checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox input[type="checkbox"]:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.checkbox:has(input[type="checkbox"]:checked) {
  border-color: #ee2b52;
  background-color: rgba(238, 43, 82, 0.06);
}

.error {
  color: #ee2b52;
  font-size: 14px;
  margin: 16px 0 0;
  min-height: 1.4em;
}

/* ==========================================================================
   Laadanimatie
   ========================================================================== */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 96px 0;
  text-align: center;
}

.loading-pulse {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #ee2b52;
  animation: pulse 1.6s ease-in-out infinite;
  margin-bottom: 32px;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.loading-text {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.loading-text::after {
  content: "";
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}

/* ==========================================================================
   Output: samenvatting van de input + de spiegeling
   ========================================================================== */

.summary {
  margin-bottom: 56px;
  padding: 28px;
  background-color: rgba(255, 255, 255, 0.03);
  border-left: 2px solid rgba(238, 43, 82, 0.5);
}

.summary-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 20px;
}

.summary-list {
  display: grid;
  gap: 16px;
  margin: 0;
}

.summary-list dt {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.summary-list dd {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

/* De daadwerkelijke spiegeling */
.response {
  margin-top: 32px;
}

.response-content {
  font-size: 17px;
  line-height: 1.85;
  word-wrap: break-word;
}

@media (min-width: 768px) {
  .response-content {
    font-size: 18px;
  }
}

/* ==========================================================================
   Spiegeling — de prose voor het Code-blok
   ========================================================================== */

.response-prose {
  margin-bottom: 56px;
}

.response-prose p {
  margin: 0 0 1.6em;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.92);
}

.response-prose p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Pagina-titel (boven spiegeling en Sleutel-pagina)
   ========================================================================== */

.page-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ee2b52;
  margin: 0 0 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(238, 43, 82, 0.25);
}

@media (min-width: 768px) {
  .page-title {
    font-size: 14px;
    margin-bottom: 56px;
  }
}

/* ==========================================================================
   Doorklik-knop "Ontgrendel de sleutel"
   ========================================================================== */

.unlock-cta {
  margin-top: 64px;
  padding-top: 48px;
  text-align: center;
  border-top: 1px solid rgba(238, 43, 82, 0.22);
  animation: unlockFadeIn 1.2s ease-out;
}

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

.unlock-cta .btn {
  margin-top: 0;
  padding: 18px 48px;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ==========================================================================
   Terug-knop op de Sleutel-pagina
   ========================================================================== */

.back-cta {
  margin-top: 56px;
  text-align: center;
  animation: unlockFadeIn 1.2s ease-out;
}

.back-cta .btn {
  margin-top: 0;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 12px 28px;
  color: rgba(255, 255, 255, 0.7);
}

.back-cta .btn:hover {
  color: #ffffff;
}

/* ==========================================================================
   Het Code-blok — een verheven blok met mooie typografie
   ========================================================================== */

.code-block {
  margin: 64px 0;
  padding: 48px 40px;
  background-color: rgba(238, 43, 82, 0.05);
  border: 1px solid rgba(238, 43, 82, 0.18);
  position: relative;
}

@media (max-width: 600px) {
  .code-block {
    padding: 36px 24px;
    margin: 48px 0;
  }
}

/* De Sleutel-naam bovenaan — prominent */
.code-block__sleutel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(238, 43, 82, 0.25);
}

.code-block__symbol {
  display: inline-block;
  font-size: 22px;
  color: #ee2b52;
  line-height: 1;
}

.code-block__sleutel-naam {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .code-block__sleutel-naam {
    font-size: 22px;
  }
}

/* De intro-tekst onder de Sleutel-naam */
.code-block__intro {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 32px;
  font-style: italic;
}

@media (min-width: 768px) {
  .code-block__intro {
    font-size: 17px;
  }
}

/* Elk van de drie secties: verlangen, loslaten, mantra */
.code-block__section {
  margin-bottom: 28px;
}

.code-block__section:last-child {
  margin-bottom: 0;
}

.code-block__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ee2b52;
  margin-bottom: 10px;
}

.code-block__body {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.95);
}

@media (min-width: 768px) {
  .code-block__body {
    font-size: 17px;
  }
}

/* Mantra: krijgt iets meer prominentie */
.code-block__section--mantra {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(238, 43, 82, 0.18);
}

.code-block__mantra {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  color: #ffffff;
  font-style: italic;
}

@media (min-width: 768px) {
  .code-block__mantra {
    font-size: 22px;
  }
}

/* ==========================================================================
   Bewustzijns-afsluiting — zacht, ingetogen
   ========================================================================== */

.response-afsluiting {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 16px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.78);
}

.response-afsluiting p {
  margin: 0 0 1.4em;
  font-weight: 300;
}

.response-afsluiting p:last-child {
  margin-bottom: 0;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 1.6em;
}

@media (min-width: 768px) {
  .response-afsluiting {
    font-size: 17px;
  }
}

/* ==========================================================================
   Streaming cursor (knipperend streepje tijdens schrijven)
   ========================================================================== */

.response-prose.streaming p:last-child::after,
.response-afsluiting.streaming p:last-child::after,
.code-block.streaming::after {
  content: "▎";
  display: inline-block;
  color: #ee2b52;
  animation: blink 1s step-end infinite;
  margin-left: 4px;
  font-weight: 400;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* ==========================================================================
   API error state
   ========================================================================== */

.api-error {
  padding: 32px;
  background-color: rgba(238, 43, 82, 0.08);
  border: 1px solid rgba(238, 43, 82, 0.3);
  text-align: center;
}

.api-error p {
  margin: 0 0 8px;
  font-size: 16px;
}

.api-error-detail {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-family: monospace;
  word-break: break-word;
}

/* ==========================================================================
   Selectie-styling
   ========================================================================== */

::selection {
  background-color: #ee2b52;
  color: #ffffff;
}

/* ==========================================================================
   Openingsanimatie — beeldvullende headerfoto, daginfo verschijnt apart.
   Niet skipbaar.

   Tijdlijn:
   - 0.0s  : foto fade-in start
   - 0.5s  : foto volledig in beeld
   - 1.0s  : daginfo-tekst fade + slide-up vanaf onderen
   - 1.6s  : daginfo volledig zichtbaar
   - 2.8s  : hele compositie (foto + tekst) glijdt omhoog weg
   - 3.7s  : animatie voltooid
   ========================================================================== */

.opening {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #000000;
  overflow: hidden;
  pointer-events: none;
  /* De hele overlay glijdt omhoog weg na 2.8s */
  animation: opening-slide-up 0.9s cubic-bezier(0.7, 0, 0.3, 1) 2.8s forwards;
}

.opening__picture {
  position: absolute;
  inset: 0;
  display: block;
}

.opening__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Beeldvullend: snijdt randen af in plaats van zwarte balken */
  object-fit: cover;
  object-position: center;
  /* Foto fade-in op pageload */
  opacity: 0;
  animation: opening-fade-in 0.5s ease-out forwards;
}

.opening__daginfo {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translate(-50%, 12px);
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  /* Tekst fade + slide-up, start op 1.0s */
  animation: opening-daginfo-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 1s forwards;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
  .opening__daginfo {
    font-size: 28px;
    bottom: 22%;
    /* Op desktop staat de foto-content rechts; daginfo onder DOORBRAAK CODE */
    left: auto;
    right: 12%;
    transform: translate(0, 12px);
  }
}

@media (min-width: 1200px) {
  .opening__daginfo {
    font-size: 32px;
    right: 14%;
  }
}

@keyframes opening-fade-in {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes opening-daginfo-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Op desktop: de daginfo komt vanuit een andere positie (rechts uitgelijnd) */
@media (min-width: 768px) {
  @keyframes opening-daginfo-in {
    from {
      opacity: 0;
      transform: translate(0, 12px);
    }
    to {
      opacity: 1;
      transform: translate(0, 0);
    }
  }
}

@keyframes opening-slide-up {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100%);
  }
}

.opening--gone {
  display: none;
}

/* ==========================================================================
   Liefs, Dolly handtekening — afsluiting op pagina 3b
   Klein, links uitgelijnd onder de afsluitende tekst
   ========================================================================== */

.signature {
  margin-top: 32px;
  text-align: left;
  animation: signatureFadeIn 1.4s ease-out;
}

.signature__image {
  display: block;
  width: 95px;
  height: auto;
  opacity: 0.95;
}

@media (min-width: 768px) {
  .signature__image {
    width: 110px;
  }
}

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

/* ==========================================================================
   Paperclip — monogram rechtsboven, sticky op alle pagina's
   Verschijnt pas na de openingsanimatie (.is-hidden wordt door JS verwijderd)
   ========================================================================== */

.paperclip {
  position: fixed;
  top: 0;
  right: 24px;
  z-index: 100;
  width: 64px;
  height: 88px;
  background-color: #ee2b52;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  /* Subtiele schaduw zodat het paperclip uit het zwart 'steekt' */
  box-shadow: 0 4px 16px rgba(238, 43, 82, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.2);
  /* Fade-in wanneer de is-hidden-klasse wordt verwijderd */
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.paperclip.is-hidden {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.paperclip__monogram {
  display: block;
  width: 42px;
  height: 42px;
  background-image: url("assets/monogram.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Op mobiel iets kleiner zodat hij niet over het Doorbraak-logo valt */
@media (max-width: 600px) {
  .paperclip {
    width: 52px;
    height: 72px;
    right: 16px;
  }
  .paperclip__monogram {
    width: 34px;
    height: 34px;
  }
}

/* Hover: heel subtiel — paperclip is geen actieve knop maar voelt levend */
.paperclip:hover {
  box-shadow: 0 6px 20px rgba(238, 43, 82, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Afzender-credit — subtiel onderaan elke pagina
   ========================================================================== */

.credit {
  position: relative;
  text-align: center;
  padding: 32px 24px 24px;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  font-style: italic;
}

@media (min-width: 768px) {
  .credit {
    font-size: 12px;
    padding: 40px 32px 32px;
  }
}

/* ==========================================================================
   Reduced motion: respecteer gebruikersvoorkeuren
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .opening {
    animation-duration: 0.3s;
    animation-delay: 2.4s;
  }
  .opening__image {
    animation: none;
    opacity: 1;
  }
  .opening__daginfo {
    animation: none;
    opacity: 1;
    transform: translate(-50%, 0);
  }
  @media (min-width: 768px) {
    .opening__daginfo {
      transform: translate(0, 0);
    }
  }
  .signature {
    animation: none;
  }
  .paperclip {
    transition: none;
  }
}
