@font-face {
  font-family: "LexendLocal";
  src: url("/statics/assets/fonts/lexend-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "SourceSansLocal";
  src: url("/statics/assets/fonts/source-sans-3-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg-top: #f5fbff;
  --bg-bottom: #ecf2ff;
  --card: #ffffff;
  --text: #16253b;
  --muted: #5a6a80;
  --line: #d9e3f5;
  --primary: #0f6fe8;
  --primary-strong: #0551b0;
  --accent: #ef6a2f;
  --danger: #b63737;
  --ok: #1f7a43;
  --radius: 18px;
  --shadow: 0 14px 38px rgba(17, 48, 90, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "SourceSansLocal", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(155deg, var(--bg-top), var(--bg-bottom));
}

.page {
  width: min(920px, 94vw);
  margin: 24px auto 48px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  top: -180px;
  right: -130px;
  background: radial-gradient(circle, rgba(18, 112, 235, 0.2), rgba(18, 112, 235, 0));
  pointer-events: none;
}

.hero h1,
h2,
label,
summary,
.btn {
  font-family: "LexendLocal", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hero h1 {
  margin: 8px 0;
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.eyebrow {
  display: inline-block;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

label {
  font-size: 14px;
}

textarea,
input[type="text"],
input[type="number"],
input[type="file"],
select {
  width: 100%;
  font-size: 16px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

input[type="range"] {
  width: 100%;
}

textarea:focus,
input:focus,
select:focus,
button:focus,
summary:focus {
  outline: 2px solid rgba(15, 111, 232, 0.35);
  outline-offset: 1px;
}

.record-panel {
  border: 1px dashed #9fb6e2;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.9), rgba(241, 247, 255, 0.9));
}

.record-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.record-head h2 {
  margin: 0;
  font-size: 18px;
}

.record-head p {
  margin: 0;
  color: var(--primary-strong);
  font-weight: 700;
}

.record-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hint {
  margin-top: 10px;
  margin-bottom: 0;
  color: var(--muted);
}

.advanced {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.advanced summary {
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.advanced-grid {
  margin-top: 12px;
}

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

.check {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  font-size: 15px;
}

.submit-row {
  margin-top: 16px;
}

.btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 65, 118, 0.14);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(120deg, #f3f8ff, #e8f1ff);
  border-color: #bfcef0;
}

.btn-cta {
  width: 100%;
  border: 0;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #f48944);
  font-weight: 700;
}

.audio {
  width: 100%;
  margin-top: 10px;
}

.status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--ok);
}

.result-card h2 {
  margin-top: 0;
}

@media (min-width: 860px) {
  .page {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .hero,
  .result-card {
    grid-column: span 2;
  }

  .advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    align-items: start;
  }

  .vector-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
