@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700;800&family=Open+Sans:wght@400;500;600;700&display=swap');

/* ========== RESET & BASE ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: #000;
  background: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========== LASKURI CONTAINER ========== */
.laskuri-wrapper {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ========== INTRO ========== */
.intro {
  text-align: center;
  margin-bottom: 36px;
}

.intro h1 {
  font-family: 'Raleway', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #ec025f;
  margin-bottom: 12px;
  line-height: 1.3;
}

.intro p {
  font-size: 15px;
  color: #444;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

.intro-teksti {
  text-align: left;
  max-width: 620px;
  margin: 0 auto;
}

.intro-teksti p {
  margin-bottom: 6px;
  line-height: 1.5;
}

/* ========== LOMAKE ========== */
.lomake-osio {
  background: #f7f7f7;
  border-radius: 12px;
  padding: 28px 28px 24px;
  margin-bottom: 24px;
}

.lomake-osio h2 {
  font-family: 'Raleway', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #ec025f;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid #16c3dd;
}

.kentta {
  margin-bottom: 16px;
}

.kentta label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.kentta label .pakollinen {
  color: #ec025f;
  margin-left: 2px;
}

.kentta input,
.kentta select {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: #000;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.kentta input:focus,
.kentta select:focus {
  border-color: #16c3dd;
  box-shadow: 0 0 0 3px rgba(22, 195, 221, 0.15);
}

.kentta input.virhe,
.kentta select.virhe {
  border-color: #ec025f;
  box-shadow: 0 0 0 3px rgba(236, 2, 95, 0.1);
}

.kentta .virhe-teksti {
  color: #ec025f;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.kentta .virhe-teksti.nayta {
  display: block;
}

/* ========== VALMENNUSKORTIT ========== */
.valmennukset-grid {
  display: grid;
  gap: 14px;
}

.valmennus-kortti {
  background: #fff;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.valmennus-kortti:hover {
  border-color: #16c3dd;
  box-shadow: 0 2px 12px rgba(22, 195, 221, 0.12);
}

.valmennus-kortti.valittu {
  border-color: #16c3dd;
  background: #f0fcfe;
  box-shadow: 0 2px 16px rgba(22, 195, 221, 0.18);
}

/* ========== SUOSITUIN BADGE ========== */
.valmennus-kortti.suosituin {
  border-color: #ec025f;
  border-width: 2px;
}

.suosituin-badge {
  display: inline-block;
  background: #ec025f;
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.valmennus-kortti.suosituin.valittu {
  border-color: #16c3dd;
}

.valmennus-kortti .radio-pallo {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ccc;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.valmennus-kortti.valittu .radio-pallo {
  border-color: #16c3dd;
  background: #16c3dd;
}

.valmennus-kortti.valittu .radio-pallo::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.valmennus-kortti .kortti-nimi {
  font-family: 'Raleway', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #000;
  padding-right: 36px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.valmennus-kortti .kortti-hinta {
  font-size: 13px;
  color: #555;
}

.valmennus-kortti .kortti-hinta span {
  color: #16c3dd;
  font-weight: 700;
}

/* ========== OSALLISTUJAT ========== */
.osallistujat-rivi {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.osallistujat-rivi input[type="number"] {
  width: 120px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  padding: 10px 14px;
}

.osallistujat-rivi .maara-teksti {
  font-size: 14px;
  color: #555;
}

/* ========== OSALLISTUJAT + KUUKAUSI RIVI ========== */
.osallistujat-kuukausi-rivi {
  display: flex;
  gap: 24px;
  align-items: flex-end;
}

.osallistujat-kuukausi-rivi .kentta {
  margin-bottom: 0;
}

/* ========== TOTEUTUSTAPA ========== */
.toteutustapa-valinnat {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.toteutustapa-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
  padding: 10px 18px;
  background: #fff;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  transition: all 0.2s;
}

.toteutustapa-label:hover {
  border-color: #16c3dd;
}

.toteutustapa-label input[type="radio"] {
  accent-color: #16c3dd;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ========== TEXTAREA ========== */
.kentta textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: #000;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  resize: vertical;
}

.kentta textarea:focus {
  border-color: #16c3dd;
  box-shadow: 0 0 0 3px rgba(22, 195, 221, 0.15);
}

/* ========== NAPIT ========== */
.napit-rivi {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #16c3dd;
  color: #fff;
  min-width: 220px;
}

.btn-primary:hover:not(:disabled) {
  background: #0fb0c9;
  box-shadow: 0 4px 16px rgba(22, 195, 221, 0.3);
}

.btn-secondary {
  background: #fff;
  color: #16c3dd;
  border: 2px solid #16c3dd;
}

.btn-secondary:hover:not(:disabled) {
  background: #f0fcfe;
}

/* ========== SPINNER ========== */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== ILMOITUS ========== */
.ilmoitus {
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  display: none;
}

.ilmoitus.onnistui {
  background: #e8f8f0;
  color: #1a7a4c;
  border: 1px solid #b3e6cc;
  display: block;
}

.ilmoitus.virhe {
  background: #fde8ee;
  color: #b8123a;
  border: 1px solid #f5b3c5;
  display: block;
}


/* ========== KIITOSVIESTI ========== */
.kiitos-viesti {
  display: none !important;
  text-align: center;
  padding: 60px 40px;
}

.kiitos-viesti.nayta {
  display: block !important;
}

.kiitos-viesti h2 {
  font-family: 'Raleway', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #ec025f;
  margin-bottom: 16px;
}

.kiitos-viesti p {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  color: #000;
  line-height: 1.7;
  margin-bottom: 8px;
}

.kiitos-viesti .kiitos-terveisin {
  margin-top: 24px;
  margin-bottom: 4px;
  color: #444;
}

.kiitos-viesti .kiitos-nimi {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #16c3dd;
  margin-bottom: 0;
}

/* ========== KORTIN KUVAUS ========== */
.kortti-kuvaus-toggle {
  background: none;
  border: none;
  color: #16c3dd;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0 0 0;
  display: block;
  text-align: left;
  transition: color 0.2s;
}

.kortti-kuvaus-toggle:hover {
  color: #0fb0c9;
}

.kortti-kuvaus {
  display: none;
  margin-top: 10px;
  font-size: 13px;
  color: #444;
  line-height: 1.65;
  padding: 12px 14px;
  background: #f0fcfe;
  border-radius: 6px;
  border-left: 3px solid #16c3dd;
}

.kortti-kuvaus.auki {
  display: block;
}

/* ========== MINIMIOSALLISTUJA VAROITUS ========== */
.varoitus-viesti {
  display: none;
  margin-top: 8px;
  padding: 9px 13px;
  background: #fff8e1;
  border: 1px solid #ffc107;
  border-radius: 6px;
  color: #7a5c00;
  font-size: 13px;
  font-weight: 600;
}

.varoitus-viesti.nayta {
  display: block;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  .laskuri-wrapper {
    padding: 16px 14px 36px;
  }

  .lomake-osio {
    padding: 20px 18px;
  }

  .intro h1 {
    font-size: 22px;
  }

  .napit-rivi {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    min-width: unset;
  }

  .osallistujat-rivi {
    flex-direction: column;
    align-items: flex-start;
  }

  .osallistujat-kuukausi-rivi {
    flex-direction: column;
    gap: 16px;
  }

  .toteutustapa-valinnat {
    flex-direction: column;
    gap: 10px;
  }

}
