:root {
  --bg1: #0b1021;
  --bg2: #0f172a;
  --card: rgba(16, 24, 40, 0.92);
  --border: #1f2937;
  --muted: #94a3b8;
  --text: #e2e8f0;
  --input: #0c1326;
  --accent: #0ea5e9;
  --accent-strong: #38bdf8;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 20% 20%, #1f2937 0, #0f172a 35%, #0b1021 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.page {
 max-width: 960px;
  width: 100%;
  padding: 0 16px;
  margin: 32px auto 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: grid;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.01em;
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 640px;
}

.card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.92));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

label,
.label,
legend {
  font-weight: 600;
  color: var(--text);
}

legend {
  padding: 0;
  font-size: 0.95rem;
}

input,
select {
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
  outline: none;
  transform: translateY(-1px);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-row input {
  flex: 1;
}

.dash {
  color: var(--muted);
  font-weight: 700;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
}

.chip input {
  accent-color: var(--accent);
}

.chip:hover {
  border-color: rgba(14, 165, 233, 0.6);
  background: rgba(14, 165, 233, 0.08);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
}

.checkbox input {
  accent-color: var(--accent);
}

.checkbox:hover {
  border-color: rgba(14, 165, 233, 0.6);
  background: rgba(14, 165, 233, 0.08);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

/* ===== BUTTON ===== */

button {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #0b1021;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.3);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(14, 165, 233, 0.4);
  filter: brightness(1.02);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.28);
}

button:disabled {
  opacity: 0.85;
  cursor: not-allowed;
}

/* ===== BUTTON LOADER ===== */

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(11,16,33,0.35);
  border-top-color: #0b1021;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== DEBUG ===== */

#output {
  margin-top: 12px;
  min-height: 90px;
  background: #0c1326;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--accent-strong);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre-wrap;
}

@media (max-width: 600px) {
  .page {
    margin: 32px auto 48px;
  }

  .card {
    padding: 22px;
  }

  .radio-row {
    gap: 8px;
  }
}

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

@media (max-width: 420px) {
  .range-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dash {
    display: none;
  }
}

#trainingBlocks {
  font-size: 1.15rem;
  line-height: 1.75;
  margin-top: 12px;
}

#trainingBlocks li {
  margin-bottom: 6px;
}

#detailsContent {
  font-size: 1.05rem;
  line-height: 1.7;
}

input,
select,
textarea,
button {
  min-width: 0;
  max-width: auto;
}

.field,
.range-row,
.radio-row,
.checkbox-grid,
.actions {
  min-width: 0;
}

.chip,
.checkbox {
  max-width: 100%;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .chip,
  .checkbox {
    white-space: normal;
  }
}

body {
  overflow-x: hidden;
}

#detailsContent {
  white-space: pre-wrap;      /* разрешаем перенос строк */
  word-wrap: break-word;      /* ломаем длинные слова */
  overflow-wrap: anywhere;    /* принудительный перенос если надо */
  max-width: 100%;
  box-sizing: border-box;
}

.input-short {
  width: 10ch;          /* визуально ~2–3 цифры */
  min-width: 6ch;
   max-width: 10ch;
  text-align: center;
}

    /* @media (max-width: 420px) {
  .input-short {
    width: 100%;
    text-align: left;
  }
} */

@media (max-width: 420px) {
  .range-row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  .dash {
    display: inline;
    margin: 0 4px;
  }

  .input-short {
    width: 6ch;        /* компактно, но удобно пальцем */
    min-width: 6ch;
    max-width: 8ch;
    text-align: center;
  }
}


.secondary-btn {
  background: linear-gradient(120deg, #22c55e, #4ade80);
  color: #052e16;
  box-shadow: 0 10px 26px rgba(34, 197, 94, 0.35);
}

.secondary-btn:hover {
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.45);
  filter: brightness(1.03);
}

.secondary-btn:active {
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

.hidden {
  display: none;
}
