/* ============================================================
   MattressInsider Video Testimonial Collector — public styles
   Mobile-first, warm, simple. Brand teal #008DA7 / #00707A.
   ============================================================ */

:root {
  --brand: #008DA7;
  --brand-dark: #00707A;
  --ink: #1f2a2e;
  --muted: #5b6b70;
  --line: #e3e8ea;
  --bg: #f6f8f9;
  --card: #ffffff;
  --danger: #c0392b;
  --ok: #1e8e6a;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 18px 64px;
}

header.site {
  text-align: center;
  padding: 22px 0 8px;
}
header.site img.logo {
  max-width: 240px;
  width: 70%;
  height: auto;
}

h1 {
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 14px 0 6px;
  color: var(--ink);
}
.subhead {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 1.02rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 16px 0;
}

.card h2 {
  font-size: 1.15rem;
  margin: 0 0 10px;
  color: var(--brand-dark);
}

.body-copy p { margin: 0 0 12px; }
.body-copy ol { margin: 8px 0 8px 1.1em; padding: 0; }
.body-copy ol li { margin: 4px 0; }
.tip {
  background: #eff7f8;
  border-left: 4px solid var(--brand);
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--brand-dark);
  font-size: 0.97rem;
  margin: 10px 0 0;
}

/* ---------- Recorder ---------- */
.recorder-stage {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.recorder-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.recorder-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cfd8db;
  text-align: center;
  padding: 18px;
  font-size: 0.98rem;
}
.rec-timer {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(192, 57, 43, 0.92);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 4px 10px;
  border-radius: 999px;
  display: none;
  align-items: center;
  gap: 6px;
}
.rec-timer .dot {
  width: 9px; height: 9px; border-radius: 50%; background: #fff;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.countdown {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 5rem;
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
button, .btn {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  min-height: 48px;
  flex: 1 1 auto;
  transition: background .15s ease, opacity .15s ease;
}
button:hover, .btn:hover { background: var(--brand-dark); }
button.secondary {
  background: #fff;
  color: var(--brand-dark);
  border: 1.5px solid var(--brand);
}
button.secondary:hover { background: #eff7f8; }
button.danger { background: var(--danger); }
button:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-fullwidth { width: 100%; flex: 1 1 100%; }

.link-btn {
  background: none;
  border: none;
  color: var(--brand-dark);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  min-height: auto;
  flex: 0 0 auto;
}

/* ---------- Form ---------- */
.field { margin: 14px 0; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.97rem;
}
.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,141,167,0.12);
}
.req { color: var(--danger); }

/* Honeypot — visually hidden, off-screen, not display:none (some bots skip those) */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  height: 1px; width: 1px;
  overflow: hidden;
}

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.consent input[type="checkbox"] {
  margin-top: 4px;
  width: 20px; height: 20px;
  flex: 0 0 auto;
}
.consent label {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Progress ---------- */
.progress-wrap { margin: 16px 0; display: none; }
.progress-bar {
  width: 100%;
  height: 14px;
  background: #e7edee;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--brand);
  transition: width .2s ease;
}
.progress-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}

/* ---------- Messages ---------- */
.msg { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: 0.95rem; }
.msg.error { background: #fdecea; color: var(--danger); border: 1px solid #f3c5be; }
.msg.ok { background: #e9f7f1; color: var(--ok); border: 1px solid #bfe6d6; }
.msg.info { background: #eef6f8; color: var(--brand-dark); border: 1px solid #cfe6ec; }
.hidden { display: none !important; }

/* ---------- Photo previews ---------- */
.photo-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.photo-previews:empty { margin-top: 0; }
.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f4;
  border: 1px solid #d8e1e5;
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-tile.pending img { opacity: 0.55; }
.photo-spin {
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid rgba(255,255,255,0.7);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: photo-spin 0.8s linear infinite;
}
@keyframes photo-spin { to { transform: rotate(360deg); } }
.photo-check {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 20px; height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 13px;
  color: #fff;
  background: var(--ok, #1f9d6b);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

footer.site {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 26px;
}
footer.site a { color: var(--brand-dark); }

@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 1.45rem; }
  .card { padding: 18px; }
  button, .btn { flex: 1 1 100%; }
}
