/* Masa Marketing — global styles.
   Layout/colour details live as inline styles in index.html so each block is editable in place.
   This file holds what inline styles cannot express: resets, keyframes, media queries, states. */

html, body { margin: 0; padding: 0; background: #070A12; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: rgba(57,255,136,0.30); color: #F8FAFC; }

a { color: #39FF88; text-decoration: none; }
a:hover { color: #8affbc; }

img { max-width: 100%; }

@keyframes masaGlow { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.9; } }
@keyframes masaPulse { 0%, 100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.15); opacity: 1; } }

/* --- responsive visibility helpers --- */
.m-only { display: none !important; }
.opt-toggle { display: none !important; }

/* --- form states --- */
input:focus, textarea:focus { border-color: rgba(57,255,136,0.55) !important; }
.goal-btn {
  padding: 12px 8px; border-radius: 11px; font-size: 13.5px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all .12s; text-align: center;
  background: transparent; color: #A7B0C0; border: 1px solid rgba(255,255,255,0.10);
}
.goal-btn:hover { color: #F8FAFC; border-color: rgba(255,255,255,0.24); }
.goal-btn.selected { background: rgba(57,255,136,0.14); color: #F8FAFC; border: 1px solid #39FF88; }

#submit-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px; border-radius: 999px; font-weight: 700; font-size: 15.5px;
  font-family: inherit; border: none; color: #070A12; background: #39FF88;
  box-shadow: 0 14px 34px -12px rgba(57,255,136,0.6); cursor: pointer;
}
#submit-btn.submit-loading {
  opacity: 0.72; cursor: progress;
}
#submit-btn.submit-disabled {
  background: rgba(57,255,136,0.4); box-shadow: none; cursor: not-allowed;
}
#form-success[hidden] { display: none; }
#form-success { display: flex; }

.cta-primary:hover { color: #070A12; filter: brightness(1.06); }

/* --- tablet --- */
@media (max-width: 1023px) {
  .masa-root section { padding-top: 64px !important; padding-bottom: 64px !important; }
}

/* --- mobile --- */
@media (max-width: 767px) {
  .masa-root section { padding: 46px 18px !important; }
  .masa-root header { padding: 24px 18px 0 !important; }
  .masa-root header img { width: 166px !important; }
  .masa-root h1 { font-size: 30px !important; line-height: 1.1 !important; }
  .masa-root h2 { font-size: 25px !important; line-height: 1.18 !important; }
  .masa-root h3 { font-size: 19px !important; }
  .masa-root a[href="#kartoitus"] { width: 100% !important; box-sizing: border-box !important; }

  .d-only { display: none !important; }
  .m-only { display: block !important; }

  /* mobile section order: hero -> form -> benefits -> pricing -> guarantee -> services -> audiences -> faq */
  #stage { display: flex; flex-direction: column; }
  #stage > .mord1 { order: 1 !important; }
  #stage > .mord2 { order: 2 !important; padding-top: 12px !important; }
  #stage > .mord3 { order: 3 !important; padding-top: 26px !important; }
  #stage > .mord4 { order: 4 !important; }
  #stage > .mord5 { order: 5 !important; }
  #stage > .mord6 { order: 6 !important; }
  #stage > .mord7 { order: 7 !important; }
  #stage > .mord8 { order: 8 !important; }
  #stage > .mord9 { order: 9 !important; }
  #stage > .mord10 { order: 10 !important; }
  #stage > footer { order: 11 !important; }

  .faq-collapsed .faq-extra { display: none !important; }
  .aud-card { padding: 16px 18px !important; }
  .aud-card > div:first-child { margin-bottom: 12px !important; }

  .m-sticky-cta { display: block; }

  .opt-toggle { display: flex !important; }
  .opt-collapsed .opt-field { display: none !important; }

  /* mobile field order: required fields, goal picker, then optional extras */
  .mform { display: flex; flex-direction: column; }
  .mform > *:nth-child(3) { order: 1; }  /* nimi + sähköposti */
  .mform > *:nth-child(4) { order: 2; }  /* puhelin + yritys */
  .mform > *:nth-child(5) { order: 4; }  /* lisätiedot-toggle */
  .mform > *:nth-child(6) { order: 5; }  /* verkkosivu */
  .mform > *:nth-child(7) { order: 3; }  /* tavoite */
  .mform > *:nth-child(8) { order: 6; }  /* budjetti */
  .mform > *:nth-child(9) { order: 7; }  /* lähetä */
  .mform > *:nth-child(10) { order: 8; }
  .mform > *:nth-child(11) { order: 9; }
}

/* --- sticky mobile CTA --- */
.m-sticky-cta {
  display: none; position: fixed; left: 50%; bottom: 18px;
  transform: translateX(-50%) translateY(10px);
  width: min(390px, calc(100% - 28px)); z-index: 9000;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.m-sticky-cta.sticky-on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.m-sticky-cta a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; box-sizing: border-box; padding: 15px; border-radius: 999px;
  background: #39FF88; color: #070A12; font-weight: 700; font-size: 15.5px;
  font-family: 'Schibsted Grotesk', -apple-system, system-ui, sans-serif; text-decoration: none;
  box-shadow: 0 14px 40px -10px rgba(57,255,136,0.6), 0 6px 18px rgba(0,0,0,0.5);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* --- video cards: three vertical (9:16) testimonial slots --- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
}
.cv-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(135deg, #0c1220, #101827);
  overflow: hidden;
  padding: 14px;
}
.cv-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 40px 40px;
}
.cv-tag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 5px 11px; border-radius: 7px;
  background: rgba(7,10,18,0.78); border: 1px solid rgba(57,255,136,0.25);
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #39FF88; font-weight: 700;
}
.cv-media, .audit-media {
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1120;
  border: 1px solid rgba(255,255,255,0.07);
}
.cv-media video, .audit-media video {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  background: #0b1120;
  border-radius: 12px;
}
.audit-media { max-width: 290px; border-radius: 14px; }
.audit-media video { border-radius: 14px; }

.cv-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background:
    radial-gradient(ellipse 120% 80% at 50% 30%, rgba(57,255,136,0.06), transparent 70%),
    #0b1120;
}
.cv-play {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(57,255,136,0.10);
  border: 1px solid rgba(57,255,136,0.32);
  color: rgba(57,255,136,0.85);
  font-size: 17px; padding-left: 3px;
}
.cv-placeholder-label {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: #5b6577;
}

@media (max-width: 1023px) {
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-grid { grid-template-columns: 1fr !important; }
  .audit-grid > div:first-child { text-align: center; }
}
@media (max-width: 767px) {
  .case-grid { grid-template-columns: minmax(0, 1fr); }
  .cv-media { max-width: 250px; }
  .audit-media { max-width: 250px; }
}

/* Shown only if a video file is missing or unplayable (set by js/main.js). */
.cv-fallback { z-index: 3; }
.cv-fallback[hidden] { display: none; }
.cv-media video, .audit-media video { position: relative; z-index: 1; }
