/* =========================================================
   ДОБРЫНЯ-ЭРУДИТ
   Тренажёр ВПР: площадь и периметр
   Подключается ПОСЛЕ erudit.css
   ========================================================= */

.ap-intro {
  max-width: 760px;
  margin: 16px auto 0;
  color: #476786;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.55;
}

.ap-settings-card {
  max-width: 720px;
  margin: 0 auto;
}

.ap-settings-footer {
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
}

.ap-exercise-card {
  max-width: 940px;
  min-height: 590px;
  margin: 0 auto;
  align-items: stretch;
}

.ap-task-text {
  max-width: 820px;
  margin: 4px auto 22px;
  color: #294f73;
  font-family: "Onest", "Segoe UI", sans-serif;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  line-height: 1.48;
  text-align: left;
}

.ap-figure-wrap {
  width: min(720px, 100%);
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid rgba(47, 141, 246, .16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 227, 107, .14), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,253,255,.96));
  box-shadow: 0 10px 24px rgba(37,91,143,.08);
}

.ap-grid-svg {
  display: block;
  width: min(620px, 100%);
  height: auto;
  overflow: visible;
}

.ap-grid-bg {
  fill: #fff;
}

.ap-grid-line {
  stroke: #d7dce0;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ap-shape {
  fill: rgba(255, 159, 50, .035);
  stroke: #f28a2b;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.ap-unit-mark {
  stroke: #f28a2b;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.ap-unit-text {
  fill: #293b4b;
  font-family: "Onest", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.ap-paper-note {
  width: min(720px, 100%);
  margin: 16px auto 0;
  color: #7890a5;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.ap-answer-area {
  margin-right: auto;
  margin-left: auto;
}

.ap-answer-line {
  display: grid;
  grid-template-columns: auto minmax(120px, 260px) auto auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ap-answer-label,
.ap-answer-unit {
  color: #456987;
  font-size: 17px;
  font-weight: 800;
}

.ap-answer-line input {
  min-width: 0;
  height: 64px;
  border: 2px solid rgba(47,141,246,.28);
  border-radius: 18px;
  padding: 0 14px;
  color: #1f5b96;
  background: rgba(255,255,255,.98);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.75),
    0 8px 18px rgba(37,91,143,.08);
  font-family: "Comfortaa", sans-serif;
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.ap-answer-line input:focus {
  border-color: var(--blue);
  box-shadow:
    0 0 0 5px rgba(47,141,246,.1),
    0 8px 18px rgba(37,91,143,.1);
}

.ap-answer-line input.is-wrong {
  border-color: #f1a4af;
  background: #fff4f5;
  animation: trainer-shake .34s ease;
}

.ap-answer-line input.is-correct {
  border-color: #71d5a5;
  background: #effff5;
}

.ap-hint {
  margin-right: auto;
  margin-left: auto;
}

.ap-solution {
  width: min(720px, 100%);
  margin: 18px auto 0;
  padding: 18px 20px;
  border: 1px solid rgba(126,217,87,.34);
  border-radius: 20px;
  background: linear-gradient(145deg, #f7fff3, #eaffdf);
  color: #315b3d;
  box-shadow: 0 9px 20px rgba(77,145,65,.08);
}

.ap-solution h3 {
  margin: 0 0 10px;
  color: #367449;
  font-family: "Comfortaa", sans-serif;
  font-size: 19px;
}

.ap-solution p {
  margin: 7px 0 0;
  line-height: 1.55;
  font-weight: 700;
}

.ap-solution .ap-equation {
  color: #244d32;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(17px, 2.3vw, 21px);
}

.ap-next-wrap {
  margin-top: 18px;
  text-align: center;
}

.ap-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ap-breakdown-item {
  padding: 16px;
  border: 1px solid rgba(47,141,246,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.8);
}

.ap-breakdown-item span {
  display: block;
  color: #668099;
  font-weight: 700;
}

.ap-breakdown-item strong {
  display: block;
  margin-top: 5px;
  color: #245f99;
  font-family: "Comfortaa", sans-serif;
  font-size: 23px;
}

@media (max-width: 700px) {
  .ap-exercise-card {
    min-height: 520px;
  }

  .ap-task-text {
    font-size: 17px;
  }

  .ap-figure-wrap {
    padding: 8px;
    border-radius: 18px;
  }

  .ap-answer-line {
    grid-template-columns: 1fr auto;
  }

  .ap-answer-label {
    grid-column: 1 / -1;
    text-align: center;
  }

  .ap-answer-line .trainer-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ap-breakdown {
    grid-template-columns: 1fr;
  }
}
