/* Rujos-studiot Oy – ajanvaraus */
:root {
  --blue: #1d6fd8;
  --blue-d: #1558ae;
  --blue-l: #e8f2fe;
  --blue-xl: #f4f9ff;
  --ink: #12233b;
  --muted: #5a6b82;
  --line: #d9e4f2;
  --card: #ffffff;
  --bg: #f6f9fd;
  --ok: #1a8f5c;
  --bad: #c43d3d;
  --r: 16px;
  --shadow: 0 1px 2px rgba(18, 35, 59, .05), 0 8px 24px rgba(18, 35, 59, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.has-bar { padding-bottom: 92px; }
a { color: var(--blue); }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }

/* Yläpalkki */
.top { background: rgba(255, 255, 255, .9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 17px; }
.langs { display: flex; gap: 4px; }
.langs a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 10px; border-radius: 999px; }
.langs a:hover { background: var(--blue-l); color: var(--blue-d); }
.langs a.on { background: var(--blue); color: #fff; }

/* Ylätunniste */
.hero { background: linear-gradient(135deg, #dcecff 0%, #eef6ff 55%, #f6f9fd 100%); border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: center; padding-top: 44px; padding-bottom: 100px; }
.eyebrow { margin: 0 0 8px; color: var(--blue-d); font-weight: 650; font-size: 14px; letter-spacing: .02em; }
.hero h1 { margin: 0 0 10px; font-size: clamp(30px, 4.2vw, 44px); line-height: 1.1; letter-spacing: -.02em; }
.lead { margin: 0 0 20px; color: var(--muted); font-size: 18px; max-width: 34em; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.facts li { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.facts svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero-art svg { width: 100%; max-width: 360px; height: auto; display: block; margin-left: auto; }
.hero-art .a1 { fill: #fff; stroke: #c7dcf6; stroke-width: 2; }
.hero-art .a2, .hero-art .a2b { fill: var(--blue); }
.hero-art .a3 { fill: #fff; }
.hero-art .a4 rect { fill: var(--blue-l); }
.hero-art .a5 { fill: var(--blue); }
.hero-art .a6 { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }

/* Kortti */
main.wrap { padding-bottom: 48px; }
main.narrow, main.admin-main { padding-top: 36px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 28px; }
.book { margin-top: -64px; position: relative; }
.step + .step { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.step h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-size: 21px; }
.num { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-grid; place-items: center; font-size: 15px; }

/* Päivät */
.days { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 8px; scroll-snap-type: x proximity; }
.dbtn {
  flex: none; scroll-snap-align: start; min-width: 78px; padding: 10px 8px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; color: var(--ink); cursor: pointer; display: grid; gap: 2px; justify-items: center; font: inherit;
}
.dbtn:hover { border-color: var(--blue); }
.dbtn .wd { font-size: 13px; color: var(--muted); }
.dbtn .dt { font-size: 17px; font-weight: 700; }
.dbtn .ct { font-size: 12px; color: var(--blue-d); background: var(--blue-l); border-radius: 999px; padding: 0 8px; }
.dbtn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.dbtn.on .wd { color: #dbe9ff; }
.dbtn.on .ct { background: rgba(255, 255, 255, .2); color: #fff; }
.dbtn:focus-visible, .slots input:focus-visible + label, .btn:focus-visible, .langs a:focus-visible { outline: 3px solid #8fbaf3; outline-offset: 2px; }

fieldset.day { border: 0; margin: 0 0 18px; padding: 0; }
fieldset.day legend { font-weight: 650; margin-bottom: 10px; padding: 0; }
body.js fieldset.day legend { color: var(--muted); font-weight: 600; font-size: 15px; }
.slots { display: flex; flex-wrap: wrap; gap: 10px; }
.slots input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slots label {
  min-width: 92px; text-align: center; padding: 11px 16px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
  font-weight: 650; background: var(--blue-xl); transition: border-color .15s, background .15s;
}
.slots label:hover { border-color: var(--blue); background: #fff; }
.slots input:checked + label { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(29, 111, 216, .3); }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); }

/* Lomake */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.f { display: grid; gap: 6px; }
.f span { font-weight: 600; font-size: 15px; }
.f em { font-style: normal; font-weight: 400; color: var(--muted); }
.wide { grid-column: 1 / -1; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29, 111, 216, .14); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.chosen { margin: 0; color: var(--muted); }
.chosen.has { color: var(--ink); font-weight: 650; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: var(--blue);
  color: #fff; font: inherit; font-weight: 650; padding: 13px 26px; cursor: pointer; text-decoration: none; min-height: 48px;
}
.btn:hover { background: var(--blue-d); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: var(--blue-l); color: var(--blue-d); }
.btn.ghost:hover { background: #d7e8fd; }
.btn.danger { background: var(--bad); }
.btn.small { padding: 7px 14px; min-height: 0; font-size: 14px; }
.alert { background: #fdeeee; border: 1px solid #f1c4c4; color: #8a2424; border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; }
.alert p { margin: 2px 0; }
.notice { background: #e9f7f0; border: 1px solid #b9e3cd; color: #12603f; border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Kelluva palkki */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0 0 max(12px, env(safe-area-inset-bottom)); pointer-events: none; }
.bar-in {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 12px 12px 20px; box-shadow: 0 10px 30px rgba(18, 35, 59, .25);
  max-width: 640px; width: auto; margin: 0 auto;
}
.bar small { display: block; color: #a9bbd3; font-size: 12px; }
.bar strong { font-size: 16px; }
.bar[hidden] { display: none; }

/* Valmis / peruutus */
.done { text-align: center; padding: 40px 28px; }
.done h1 { margin: 8px 0 12px; font-size: 28px; }
.when { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.ok-icon { width: 64px; height: 64px; border-radius: 50%; background: #e3f5ec; display: grid; place-items: center; margin: 0 auto; }
.ok-icon svg { width: 34px; height: 34px; fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.prose h1 { margin-top: 0; font-size: 26px; }
.prose h2 { font-size: 17px; margin: 22px 0 6px; }
.prose p { margin: 0 0 8px; color: #2b3d56; }
.muted { color: var(--muted); font-size: 14px; }

/* Hallinta */
.admin table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin th, .admin td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin th { font-size: 13px; color: var(--muted); font-weight: 600; }
.admin h2 { margin: 28px 0 12px; font-size: 19px; }
.admin h2:first-child { margin-top: 0; }
.admin .msg { white-space: pre-wrap; color: var(--muted); font-size: 14px; max-width: 360px; }
.admin form.inline { display: inline; }
.admin .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.admin .row label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.admin .row input { width: auto; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--blue-l); color: var(--blue-d); }
.tag.x { background: #fdeeee; color: #8a2424; }

/* Alatunniste */
.foot { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }

@media (max-width: 760px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 28px; padding-bottom: 72px; }
  .hero-art { display: none; }
  .card { padding: 20px; }
  .book { margin-top: -52px; }
  .fields { grid-template-columns: 1fr; }
  .slots label { min-width: calc(33.33% - 7px); flex: 1 0 calc(33.33% - 7px); }
  .submit-row .btn { width: 100%; }
  .bar-in { margin: 0 12px; padding-left: 16px; }
  .bar strong { font-size: 15px; }
  .lead { font-size: 16px; }
  .admin table, .admin thead, .admin tbody, .admin tr, .admin td { display: block; }
  .admin thead { display: none; }
  .admin tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .admin td { border: 0; padding: 3px 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
