/* Shared look for the joining pages: index.html, joined.html, privacy.html.
   Plain white, one navy blue, and the breathing wave logo. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --navy: #14284b;
  --ink: #14284b;
  --muted: #5b6b86;
  --line: #e3e9f2;
  --soft: #f4f7fb;
  --error: #b3261e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 16px 16px 32px;
  position: relative;
  overflow-x: hidden;
}

/* The sea under the joining form: waves right below the button, then navy ocean down to the
   bottom of the screen, so the waves are always in view with no empty gap above them.
   body[data-scene] picks what's on the water: boat, sun, breath or bubbles. */
body:has(.sea) { background: #fbfcfe; flex-direction: column; justify-content: flex-start; align-items: center; padding-bottom: 0; min-height: 100svh; }
.sea {
  position: relative; flex: 0 0 112px; align-self: stretch; margin: 12px -16px 0;
  overflow: hidden; pointer-events: none;
  --tide-top: 0px;
  background: linear-gradient(#14284b, #14284b) left bottom / 100% calc(100% - var(--tide-top) - 92px) no-repeat;
}
.tide { position: absolute; left: 0; top: var(--tide-top); width: 100%; height: 100px; z-index: 1; }
.tide .swell { animation: tide 8s ease-in-out infinite; }
@keyframes tide { 0%, 100% { transform: translateY(14px); } 50% { transform: translateY(-8px); } }
.sun, .breath, .bubbles, .boat { display: none; }

/* Boat: a little boatman rowing on the navy wave. Drifts across, rides the swell, rocks,
   and his oar rows. Drawn separately so he never gets stretched with the waves. */
body[data-scene="boat"] .boat { display: block; }
.boat { position: absolute; top: 46px; left: 8%; width: 46px; height: 32px; z-index: 2; animation: drift 46s ease-in-out infinite alternate; }
.boat .ride { animation: ride 8s ease-in-out infinite; }
.boat .rock { transform-origin: 50% 80%; animation: rock 4s ease-in-out infinite; }
.boat .oar { transform-origin: 23px 19px; animation: row 2.4s ease-in-out infinite; }
@keyframes drift { from { left: 8%; } to { left: calc(92% - 46px); } }
@keyframes ride { 0%, 100% { transform: translateY(9px); } 50% { transform: translateY(-5px); } }
@keyframes rock { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes row { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(14deg); } }

/* Sun: a soft morning sun rising from behind the waves, and slowly setting again. */
body[data-scene="sun"] .sea { --tide-top: 34px; min-height: 146px; }
body[data-scene="sun"] .sun { display: block; }
.sun {
  position: absolute; right: 18%; top: 0; width: 44px; height: 44px; border-radius: 50%; z-index: 0;
  background: #ffc896; box-shadow: 0 0 22px 10px rgba(255, 200, 150, 0.45);
  animation: sunrise 24s ease-in-out -14s infinite alternate;
}
@keyframes sunrise { from { transform: translateY(70px); } to { transform: translateY(4px); } }

/* Breath: "breathe in" as the tide rises, "breathe out" as it falls, in time with the waves. */
body[data-scene="breath"] .sea { --tide-top: 22px; min-height: 134px; }
body[data-scene="breath"] .breath { display: block; }
.breath { position: absolute; left: 0; right: 0; top: 0; height: 20px; text-align: center; z-index: 2; }
.breath span {
  position: absolute; left: 0; right: 0; color: var(--muted); font-size: 13px; letter-spacing: 0.22em; opacity: 0;
  animation: 8s ease-in-out infinite;
}
.breath .in { animation-name: breathe-in; }
.breath .out { animation-name: breathe-out; }
@keyframes breathe-in { 0% { opacity: 0; } 12%, 40% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes breathe-out { 0%, 50% { opacity: 0; } 62%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* Bubbles: tiny bubbles rising out of the water, like slow exhales. */
body[data-scene="bubbles"] .bubbles { display: block; }
.bubbles { position: absolute; inset: 0; z-index: 2; }
.bubbles i {
  position: absolute; bottom: 0; width: 8px; height: 8px; border-radius: 50%; opacity: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.85); background: rgba(159, 179, 209, 0.35);
  animation: bubble 7s ease-in infinite;
}
.bubbles i:nth-child(1) { left: 12%; animation-delay: 0s; }
.bubbles i:nth-child(2) { left: 26%; width: 5px; height: 5px; animation-delay: 2.6s; }
.bubbles i:nth-child(3) { left: 41%; width: 10px; height: 10px; animation-delay: 1.2s; }
.bubbles i:nth-child(4) { left: 57%; width: 6px; height: 6px; animation-delay: 4.1s; }
.bubbles i:nth-child(5) { left: 70%; animation-delay: 3.2s; }
.bubbles i:nth-child(6) { left: 83%; width: 5px; height: 5px; animation-delay: 5.4s; }
.bubbles i:nth-child(7) { left: 93%; width: 7px; height: 7px; animation-delay: 0.7s; }
@keyframes bubble {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 1; }
  50% { transform: translate(6px, -60px); }
  85% { opacity: 0.8; }
  100% { transform: translate(-4px, -105px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tide .swell, .boat, .boat .ride, .boat .rock, .boat .oar, .sun, .bubbles i { animation: none; }
  .breath .in { animation: none; opacity: 1; }
}
main { width: 100%; max-width: 400px; }

/* Logo: a wave that slowly breathes in and out, above the word "daily". */
.brand { text-align: center; margin-bottom: 18px; }
.brand svg { display: block; margin: 0 auto; width: 76px; height: 28px; overflow: visible; }
.brand .wave { transform-origin: center; animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scaleY(0.6); } 50% { transform: scaleY(1.15); } }
@media (prefers-reduced-motion: reduce) { .brand .wave { animation: none; } }
.brand h1 { margin: 6px 0 2px; font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.brand p { margin: 0; color: var(--muted); }

.intro { margin: 0 0 14px; color: var(--muted); text-align: center; }
.intro p { margin: 0 0 6px; text-wrap: balance; }
body:has(.sea) .intro p { white-space: nowrap; font-size: clamp(12.5px, 3.85vw, 16px); }

.card h2 { margin: 0 0 8px; font-size: 22px; text-align: center; }
.card p { margin: 0 0 10px; color: var(--muted); text-align: center; }

label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 5px; }
input, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
input:focus, select:focus { outline: 2px solid var(--navy); outline-offset: 1px; border-color: transparent; }
.phone { display: grid; grid-template-columns: 104px 1fr; gap: 8px; }

.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 16px; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); }
.consent a, .card a:not(.button), .small a { color: var(--navy); }

.button {
  display: block;
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 14px;
  padding: 15px;
  background: var(--navy);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button[disabled] { opacity: 0.55; cursor: default; }
.button.secondary { background: var(--soft); color: var(--navy); font-weight: 600; font-size: 15px; }

.error { color: var(--error); font-size: 14px; margin-top: 12px; min-height: 1em; text-align: center; }
.small { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.prose h2 { font-size: 18px; margin: 22px 0 6px; text-align: left; }
.prose p, .prose li { color: var(--ink); text-align: left; }
.prose ul { padding-left: 20px; }

/* The joining page fills exactly one phone screen: the form takes the space above a slim
   sea, and its gaps grow or shrink with the screen height, so nothing needs scrolling. */
body:has(.sea) { padding-top: clamp(10px, 4svh, 40px); }
body:has(.sea) main { flex: 1 0 auto; display: flex; flex-direction: column; }
/* Spare height is shared: the form sits a little below the subtitle, not glued to it. */
body:has(.sea) main > .card { margin-block: auto; }
body:has(.sea) .brand { margin-bottom: clamp(12px, 4svh, 36px); }
body:has(.sea) label { margin: clamp(10px, 2.4svh, 22px) 0 6px; }
body:has(.sea) input, body:has(.sea) select { padding: clamp(10px, 1.6svh, 14px) 14px; }
body:has(.sea) .consent { margin-top: clamp(14px, 2.8svh, 26px); }
body:has(.sea) .button { margin-top: clamp(14px, 3svh, 28px); }
@media (max-height: 700px) {
  body:has(.sea) { padding-top: 8px; }
  body:has(.sea) .brand { margin-bottom: 14px; }
  body:has(.sea) .brand h1 { font-size: 34px; margin-top: 2px; }
  body:has(.sea) label { margin: 12px 0 5px; }
  body:has(.sea) input, body:has(.sea) select { padding: 10px 14px; }
  body:has(.sea) .consent { margin-top: 14px; }
  body:has(.sea) .button { margin-top: 16px; }
  .sea { flex-basis: 100px; margin-top: 6px; }
}

/* The 6-digit code box shown after the WhatsApp code is sent. */
.code-input { text-align: center; letter-spacing: 0.5em; font-size: 24px; font-weight: 600; margin-top: 8px; }
