/* =========================================================
   TIPOGRAFÍAS LOCALES (TIMUN + FUTURA PT)
   ========================================================= */
@font-face {
  font-family: 'Timun';
  src: url('assets/fonts/Timun-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Timun';
  src: url('assets/fonts/Timun-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Timun';
  src: url('assets/fonts/Timun-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Futura PT';
  src: url('assets/fonts/FuturaPTBook.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Futura PT';
  src: url('assets/fonts/FuturaPTDemi.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Futura PT';
  src: url('assets/fonts/FuturaPTBold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --c-red: #D83D3D;
  --c-coral: #FE5A48;
  --c-yellow: #FFC567;
  --c-green: #009A5D;
  --c-blue: #1B88CA;
  --c-purple: #542CB7;
  --c-pink: #FC7DA8;
  --c-ink: #121212;
  --font-display: 'Timun', sans-serif;
  --font-body: 'Futura PT', sans-serif;
  --header-h: 82px;
}

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

html,
body {
  width: 100%;
  height: 100%;
  font-family: var(--font-body);
  font-weight: 400;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--c-ink);
  background-color: #3b1c8c;
  background-image: url('assets/Background.png');
  background-size: 2080px auto;
  background-repeat: repeat;
  background-blend-mode: lighten;
  overflow: hidden;
}

/* =========================================================
   HEADER SUPERIOR FIJO
   ========================================================= */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: #ffffff;
  border-radius: 0 0 42px 42px;
  z-index: 120;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.header-inner {
  max-width: 1400px;
  height: 100%;
  margin: 0 auto;
  padding: 0 42px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo-bajada {
  height: 98px;
  width: auto;
  transform: translateY(12px);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.18));
  user-select: none;
}

.logo-andamos {
  height: 76px;
  width: auto;
  transform: translateY(8px);
  user-select: none;
}

/* =========================================================
   LAYOUT DESKTOP (>= 992px)
   ========================================================= */
.main-stage {
  position: relative;
  max-width: 1400px;
  height: 100vh;
  margin: 0 auto;
  padding: calc(var(--header-h) + 28px) 42px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 375px;
  gap: 38px;
}

.wall-column {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 28px);
  min-height: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.35rem, 2.15vw, 2.05rem);
  line-height: 1.22;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 22px;
  flex-shrink: 0;
}

.hero-title span {
  color: var(--c-coral);
}

/* Área con scroll exclusivo para los papelitos */
.notes-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px 48px 10px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 197, 103, 0.7) rgba(0, 0, 0, 0.15);
}

.notes-scroll::-webkit-scrollbar {
  width: 8px;
}
.notes-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 99px;
}
.notes-scroll::-webkit-scrollbar-thumb {
  background: var(--c-yellow);
  border-radius: 99px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 22px;
  align-items: stretch;
}

/* =========================================================
   PAPELITOS DE EXCUSAS (STICKY NOTES)
   ========================================================= */
.sticky-note {
  position: relative;
  aspect-ratio: 1 / 1.02;
  min-height: 195px;
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--note-bg, var(--c-yellow));
  color: var(--c-ink);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  transform: rotate(var(--note-rot, -2deg));
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.sticky-note:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.36);
  z-index: 5;
}

.sticky-note__text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.16rem;
  line-height: 1.26;
  word-break: break-word;
}

.sticky-note__pending {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.35);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.85);
}

.sticky-note.is-hidden-slot {
  opacity: 0;
  transform: scale(0.4);
}

.sticky-note.pop-in {
  animation: noteUnfoldPop 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes noteUnfoldPop {
  0% {
    opacity: 0;
    transform: scale(0.35) rotate(-10deg);
  }
  100% {
    opacity: 1;
    transform: rotate(var(--note-rot, -2deg)) scale(1);
  }
}

/* =========================================================
   FORMULARIO (FIJO EN DESKTOP)
   ========================================================= */
.drawer-backdrop {
  display: none;
}

.form-panel {
  align-self: end;
  width: 100%;
  max-height: calc(100vh - var(--header-h) - 10px);
  display: flex;
  flex-direction: column;
  z-index: 130;
}

.hat-trigger {
  background: none;
  border: none;
  padding: 0;
  width: 100%;
  display: block;
  text-align: left;
  cursor: default;
  margin-bottom: -14px;
  position: relative;
  z-index: 3;
}

.header-form-img {
  width: 103%;
  max-width: 390px;
  margin-left: -10px;
  height: auto;
  display: block;
  user-select: none;
}

.form-card {
  background: var(--c-yellow);
  padding: 24px 26px 26px;
  box-shadow: 0 -6px 26px rgba(0, 0, 0, 0.28);
  overflow-y: auto;
}

.input-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 3px solid #000000;
  padding-top: 8px;
  padding-bottom: 3px;
  margin-bottom: 8px;
}

.input-line label,
.excusa-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.22rem;
  color: #000000;
  white-space: nowrap;
  flex-shrink: 0;
}

.input-line input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.12rem;
  color: #111111;
}

/* Textarea con 4 renglones reales estilo cuaderno */
.excusa-block {
  position: relative;
  margin-top: 10px;
  margin-bottom: 14px;
}

.excusa-label {
  position: absolute;
  top: 0;
  left: 0;
  line-height: 34px;
  pointer-events: none;
}

.excusa-block textarea {
  width: 100%;
  height: 136px;
  border: none;
  outline: none;
  resize: none;
  background-color: transparent;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 31px,
    #000000 31px,
    #000000 34px
  );
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.08rem;
  line-height: 34px;
  text-indent: 112px;
  color: #111111;
  overflow-y: auto;
}

/* Honeypot oculto para usuarios reales */
.hp-wrap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.legal-note {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.22;
  color: #111111;
  margin-bottom: 14px;
}

.form-feedback {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  color: #ffffff;
  background: var(--c-red);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.submit-wrap {
  position: relative;
  padding-top: 8px;
}

.sunglasses-deco {
  position: absolute;
  right: -14px;
  top: -18px;
  width: 112px;
  height: auto;
  pointer-events: none;
  z-index: 2;
}

.submit-btn {
  width: 100%;
  border: none;
  background: var(--c-purple);
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.24rem;
  letter-spacing: 0.01em;
  padding: 13px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.submit-btn:hover {
  background: #432098;
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* =========================================================
   CAPA DE ANIMACIÓN (PLEGADO + AVIÓN + ESTELA)
   ========================================================= */
.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

.flight-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.folding-sheet {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 130px;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  perspective: 600px;
  opacity: 0;
  transform-origin: center center;
}

.sheet-body {
  background: var(--c-yellow);
  border-top: 2px solid #181818;
  border-bottom: 2px solid #181818;
  padding: 10px 6px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.82rem;
  overflow: hidden;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-flap {
  background: #f3b54c;
  border: 2px solid #181818;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.sheet-flap-left {
  transform-origin: right center;
}

.sheet-flap-right {
  transform-origin: left center;
}

.folding-sheet.is-folding {
  opacity: 1;
  transition: transform 0.48s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease 0.36s;
  transform: scale(0.35) rotate(-14deg);
}

.folding-sheet.is-folding .sheet-flap-left {
  transform: rotateY(145deg) skewY(-18deg);
}

.folding-sheet.is-folding .sheet-flap-right {
  transform: rotateY(-145deg) skewY(18deg);
}

.paper-plane {
  position: fixed;
  left: 0;
  top: 0;
  width: 68px;
  height: 52px;
  margin-left: -34px;
  margin-top: -26px;
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

/* =========================================================
   DISEÑO MOBILE (< 992px)
   ========================================================= */
@media (max-width: 991px) {
  :root {
    --header-h: 74px;
  }

  .top-header {
    border-radius: 0 0 32px 32px;
  }

  .header-inner {
    padding: 0 14px;
    justify-content: center;
    gap: 12px;
  }

  .logo-bajada {
    height: 82px;
    transform: translateY(10px);
  }

  .logo-andamos {
    height: 64px;
    transform: translateY(8px);
  }

  .main-stage {
    display: block;
    padding: calc(var(--header-h) + 14px) 12px 0;
  }

  .hero-title {
    display: none;
  }

  .wall-column {
    height: calc(100vh - var(--header-h) - 14px);
  }

  .notes-scroll {
    padding: 12px 6px 145px;
  }

  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 14px;
  }

  .sticky-note {
    min-height: 165px;
    padding: 14px 12px;
  }

  .sticky-note__text {
    font-size: 1rem;
    line-height: 1.24;
  }

  .sticky-note__pending {
    font-size: 0.72rem;
    margin-top: 8px;
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(14, 6, 36, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 140;
  }

  .drawer-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .form-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 92vh;
    z-index: 150;
    transform: translateY(calc(100% - 76px));
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    touch-action: pan-y;
  }

  .form-panel.is-open {
    transform: translateY(0);
  }

  .hat-trigger {
    cursor: pointer;
    width: min(88vw, 345px);
    margin: 0 auto -22px;
    touch-action: none;
  }

  .header-form-img {
    width: 100%;
    margin-left: 0;
  }

  .form-card {
    border: 4px solid #000000;
    border-bottom: none;
    border-radius: 34px 34px 0 0;
    padding: 30px 22px 24px;
  }
}