/* Rae Vallavalitsus · Automatiseerimise register
   Palett:  paber #F4F6F5 · tint #14232B · petrol #0C6B72 · sügav #083F52
            merevaik #F2B705 (aktsent) · savi #8C8178 (käsitsi) · roheline #2E7D5B
   Kiri:    Sora (pealkirjad) + Inter (tekst) */

:root {
  --paper: #f4f6f5;
  --paper-2: #ffffff;
  --ink: #14232b;
  --ink-soft: #46555c;
  --petrol: #0c6b72;
  --petrol-deep: #083f52;
  --amber: #f2b705;
  --amber-soft: #fff3cf;
  --clay: #8c8178;
  --green: #2e7d5b;
  --line: #dde3e2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(8, 63, 82, .06), 0 8px 24px rgba(8, 63, 82, .07);
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand { font-family: "Sora", "Inter", sans-serif; }

a { color: var(--petrol-deep); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 720px; }

/* Klaviatuurikasutaja: nähtav fookus */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* ---- Topbar ---- */
.topbar { border-bottom: 1px solid var(--line); background: var(--paper-2); }
.topbar-inner { display: flex; align-items: baseline; gap: 12px; padding-top: 16px; padding-bottom: 16px; }
.brand { font-weight: 700; letter-spacing: -.01em; color: var(--petrol-deep); }
.brand-sub { color: var(--ink-soft); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; }

/* ---- Hero ---- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -20%, rgba(12, 107, 114, .10), transparent 60%),
    linear-gradient(180deg, var(--paper-2), var(--paper));
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding: 68px 24px 76px; }
.eyebrow {
  margin: 0 0 14px; font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em; color: var(--petrol);
}
.hero h1 {
  margin: 0 0 28px; font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.08; letter-spacing: -.02em; font-weight: 700; max-width: 16ch;
}
.lede { max-width: 62ch; font-size: 1.08rem; color: var(--ink-soft); margin: 26px 0 32px; }

/* Signatuur: Käsitsi -> Automaatne */
.transform {
  display: inline-flex; align-items: center; gap: 0;
  padding: 10px 14px; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.pill {
  font-family: "Sora", sans-serif; font-weight: 600; font-size: .92rem;
  padding: 8px 18px; border-radius: 999px; white-space: nowrap;
}
.pill-manual { color: var(--clay); border: 1.5px dashed var(--clay); background: #fbfaf9; }
.pill-auto {
  color: #fff; background: var(--petrol);
  box-shadow: 0 0 0 4px rgba(12, 107, 114, .12);
}
.flow {
  position: relative; width: 78px; height: 2px; margin: 0 8px;
  background: linear-gradient(90deg, var(--clay), var(--petrol));
  border-radius: 2px;
}
.flow::after {
  content: ""; position: absolute; right: -1px; top: -4px;
  border: 5px solid transparent; border-left-color: var(--petrol);
}
.spark {
  position: absolute; top: 50%; left: 0; width: 8px; height: 8px;
  margin-top: -4px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 8px 2px rgba(242, 183, 5, .6);
  animation: run 2.6s ease-in-out infinite;
}
@keyframes run { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 70px; opacity: 0; } }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* ---- Nupud ---- */
.btn {
  display: inline-block; font-family: "Sora", sans-serif; font-weight: 600;
  font-size: .98rem; text-decoration: none; cursor: pointer;
  padding: 13px 24px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--petrol); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--petrol-deep); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--petrol-deep); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--petrol); background: var(--paper-2); }
.btn-lg { font-size: 1.05rem; padding: 15px 30px; }

/* ---- Sektsioonid ---- */
.section { padding: 62px 0; }
.section-quiet { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.01em; margin: 0 0 10px; }
.section-title .count, .count {
  font-family: "Inter", sans-serif; font-weight: 500; font-size: .8rem;
  color: var(--ink-soft); vertical-align: middle; margin-left: 10px;
  background: var(--paper); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px;
}
.section-lead { max-width: 64ch; color: var(--ink-soft); margin: 0 0 34px; }
.section-lead strong { color: var(--ink); }

/* ---- Kaardid: mida saab automatiseerida ---- */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--amber);
}
.card-tag {
  display: inline-block; font-family: "Sora", sans-serif; font-weight: 600;
  font-size: .95rem; color: var(--petrol-deep); margin-bottom: 8px;
}
.card p { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* ---- Julgustus ---- */
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding: 0 0 16px 34px; color: var(--ink-soft); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--amber-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230c6b72' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.callout {
  background: var(--petrol-deep); color: #eaf3f2; border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.callout-big { font-family: "Sora", sans-serif; font-weight: 600; font-size: 1.3rem; line-height: 1.25; margin: 0 0 14px; color: #fff; }
.callout p { color: #cfe1e0; }
.callout .btn-primary { background: var(--amber); color: var(--ink); margin-top: 10px; }
.callout .btn-primary:hover { background: #ffcb2e; }

/* ---- Vorm ---- */
.form { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.field { margin-bottom: 22px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 7px; font-size: .95rem; }
.req { color: #c0392b; }
.hint { margin: 7px 0 0; font-size: .85rem; color: var(--ink-soft); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.row .field { margin-bottom: 22px; }

input[type="text"], input[type="email"], input[type="number"], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
input:hover, textarea:hover, select:hover { border-color: #c3cccb; }
input:focus, textarea:focus, select:focus { border-color: var(--petrol); background: #fff; }
textarea { resize: vertical; }
::placeholder { color: #9aa4a3; }

.field-contact { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 20px; background: var(--paper); }
.field-contact legend { padding: 0 8px; }

/* ---- Flash-teated ---- */
.flash { margin: 28px auto 0; padding: 16px 20px; border-radius: var(--radius-sm); font-weight: 500; }
.flash-ok { background: #e6f4ec; color: #1d5b3f; border: 1px solid #b7ddc7; }
.flash-viga { background: #fdecea; color: #9a2b1e; border: 1px solid #f2c4bd; }

/* ---- Viimased ideed ---- */
.ideas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.idea { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.idea-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.idea-amet { font-size: .78rem; color: var(--ink-soft); }
.idea-title { font-size: 1.05rem; margin: 0 0 8px; line-height: 1.3; }
.idea-idee { margin: 0 0 10px; font-size: .92rem; color: var(--ink-soft); }
.idea-meta { margin: 0; font-size: .8rem; color: var(--clay); }
.status {
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft);
}
.status-uus { background: var(--amber-soft); border-color: #f0dfa0; color: #7a5c00; }
.status-vaatluses { background: #e8f0f6; border-color: #c3d8ea; color: #2b5a80; }
.status-plaanis { background: #eef1fb; border-color: #cfd6f2; color: #3a469b; }
.status-tehtud { background: #e6f4ec; border-color: #b7ddc7; color: #1d5b3f; }
.status-ei_sobi { background: #f1f2f2; border-color: var(--line); color: #6a7472; }
.empty { color: var(--ink-soft); }

/* ---- Footer ---- */
.footer { padding: 40px 0; background: var(--ink); color: #c6d2d1; }
.footer p { margin: 0 0 4px; }
.footer-sub { font-size: .88rem; color: #93a3a2; }

/* ---- Responsiivsus ---- */
@media (max-width: 860px) {
  .cards, .ideas { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero-inner { padding: 48px 24px 54px; }
  .cards, .ideas, .row { grid-template-columns: 1fr; }
  .transform { flex-wrap: nowrap; }
  .flow { width: 48px; }
  @keyframes run { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 42px; opacity: 0; } }
}

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