/* ===== Traga sua ideia (carta) ===== */
.ideia {
  --line: 38px;
  position: relative;
  margin-top: clamp(80px, 10vw, 140px);
  font-family: "Plus Jakarta Sans", sans-serif;
  color: #1f2a22;
}

.ideia-board {
  max-width: 1000px;
  margin: 0 auto;
  background: #fbf8f1;
  padding: clamp(28px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
}



.letter {
  --to: translate(70%, 0);
  position: relative;
  background-color: #fffdf7;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), #e2dccd calc(var(--line) - 1px), #e2dccd var(--line));
  background-position: 0 var(--shift, -3px);
  padding: var(--line) 44px var(--line);
  transform: rotate(-1.2deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  transform-origin: center top;
}

.letter > * { margin: 0; }

.letter .label,
.letter-hello,
.letter textarea,
.letter-sign,
.letter-from,
.letter-from input,
.letter-error {
  line-height: var(--line);
}

.letter .label { margin: 0; }

.letter-hello {
  font-weight: 400;
  font-style: italic;
  font-size: 1.9rem;
}

.letter textarea,
.letter input {
  font: inherit;
  color: #1f2a22;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
}

.letter textarea {
  display: block;
  width: 100%;
  resize: none;
  overflow: hidden;
  font-size: 1.05rem;
  line-height: var(--line);
  height: calc(var(--line) * 5);
}

.letter-sign { font-style: italic; }

.letter-from {
  display: flex;
  align-items: center;
  gap: 8px;
  font-style: italic;
}

.letter-from input {
  flex: 1;
  min-width: 0;
  height: var(--line);
  font-style: italic;
}

.letter ::placeholder { color: #a3a89f; }

.letter-error {
  min-height: var(--line);
  font-size: 0.85rem;
  color: #a8433a;
}


.mail {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.envelope {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 3 / 2;
  background: #efe6d2;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  margin-bottom: 28px;
}

.envelope::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom right, transparent 49.5%, #e3d7bd 50%) left / 50% 100% no-repeat,
    linear-gradient(to bottom left, transparent 49.5%, #e3d7bd 50%) right / 50% 100% no-repeat;
}

.env-flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 55%;
  background: #e8dcc2;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 0.35s ease;
  z-index: 1;
}

.env-seal {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a8433a, #6e1f1a 70%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), inset 0 0 0 7px rgba(0, 0, 0, 0.12);
  clip-path: polygon(50% 0, 61% 4%, 72% 2%, 80% 10%, 91% 12%, 93% 24%, 100% 33%, 96% 45%, 100% 56%, 94% 66%, 95% 79%, 85% 85%, 79% 95%, 67% 95%, 57% 100%, 46% 96%, 34% 99%, 26% 91%, 14% 89%, 10% 78%, 2% 69%, 5% 57%, 0 46%, 6% 36%, 4% 24%, 14% 17%, 19% 7%, 31% 6%, 41% 0);
  transform: translate(-50%, -50%) scale(2.2);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(.5, 0, .7, 1.4), opacity 0.15s ease;
  z-index: 2;
}

.env-seal img {
  width: 80px;
  filter: invert(1) sepia(1) saturate(2) hue-rotate(-30deg) brightness(0.75);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.letter-btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  background: #1f2a22;
  color: #fbf8f1;
  cursor: pointer;
  transition: background 0.25s ease, opacity 0.25s ease;
}

.letter-btn:hover { background: #33453a; }
.letter-btn:disabled { opacity: 0.5; cursor: default; }

.mail-note {
  margin-top: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #7b8278;
  max-width: 260px;
  min-height: 2.7em;
}

.mail-note a { color: #1f2a22; font-weight: 600; }


.ideia.sending .letter { animation: letter-send 0.8s cubic-bezier(.6, 0, .4, 1) forwards; }

@keyframes letter-send {
  0%   { transform: rotate(-1.2deg); opacity: 1; }
  40%  { transform: rotate(0deg) scaleY(0.3); opacity: 1; }
  100% { transform: var(--to) scale(0.15); opacity: 0; }
}


.ideia.sending .letter-btn,
.ideia.sending .mail-note { opacity: 0; }

.mail-note { transition: opacity 0.25s ease; }


.ideia.sealed .env-flap { transform: scaleY(1); }

.ideia.centering .envelope {
  transform: translate(var(--cx, 0px), var(--cy, 0px)) scale(1.15);
  transition: transform 0.6s cubic-bezier(.5, 0, .2, 1);
  z-index: 5;
}


.ideia.stamped .env-seal {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}


.ideia.flying .envelope { animation: env-fly 0.75s cubic-bezier(.55, 0, .8, .2) forwards; }

@keyframes env-fly {
  0%   { transform: translate(var(--cx), var(--cy)) scale(1.15); }
  20%  { transform: translate(calc(var(--cx) - 20px), calc(var(--cy) - 10px)) scale(1.15) rotate(-4deg); }
  100% { transform: translate(calc(var(--cx) + 120vw), calc(var(--cy) - 30vh)) scale(1.15) rotate(18deg); }
}


.ideia.returning .env-flap,
.ideia.returning .env-seal { transition: none; }

.ideia.returning .letter { animation: letter-in 0.6s ease both; }
.ideia.returning .envelope { animation: env-in 0.6s ease 0.15s both; }

@keyframes letter-in {
  from { opacity: 0; transform: translateY(30px) rotate(-1.2deg); }
  to   { opacity: 1; transform: rotate(-1.2deg); }
}

@keyframes env-in {
  from { opacity: 0; transform: translateY(20px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 800px) {
  .ideia-board { grid-template-columns: 1fr; }
  .letter { --to: translate(0, 90%); padding: var(--line) 24px; transform: rotate(-0.8deg); }
  .letter-from { flex-wrap: wrap; gap: 0; }
  .letter-from span { display: none; }
  .letter-from input { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ideia * { animation-duration: 0.01s !important; transition-duration: 0.01s !important; }
}


.privacy {
  margin-top: 12px;
  font-size: 0.78rem;
  color: #7b8278;
  max-width: 260px;
}

.ideia.sending .privacy { opacity: 0; }


.letter .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
