:root {
  --cobalt: #1f3bff;
  --cobalt-ink: #0b1b6b;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f5f7ff;
  --card: #ffffff;
  --error: #b42318;
  --error-bg: #fef3f2;
  --info-bg: #eef2ff;
  --ok: #067647;
  --radius: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}
a { color: var(--cobalt); }
h2 { font-size: 1rem; margin: 0 0 12px; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--cobalt-ink); color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .2px; }
.brand span { opacity: .7; font-weight: 600; }
.lang {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .8rem; cursor: pointer;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 8px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 860px) {
  .grid { grid-template-columns: 360px 1fr; align-items: start; }
  .grid .submit { grid-column: 2; }
  .grid .preview { grid-row: span 2; position: sticky; top: 16px; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.account { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--line); flex: none; }
.nick { font-weight: 800; font-size: 1.15rem; margin: 0; }
.handle { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

.media video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.gallery { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.gallery button {
  position: relative; flex: 0 0 78%; padding: 0; border: 3px solid transparent; border-radius: 12px;
  background: none; cursor: pointer; scroll-snap-align: center;
}
.gallery img { display: block; width: 100%; border-radius: 9px; }
.gallery button[aria-pressed="true"] { border-color: var(--cobalt); }
.gallery .badge {
  position: absolute; left: 8px; top: 8px; background: var(--cobalt); color: #fff;
  font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 2px 10px;
}
.gallery .num {
  position: absolute; right: 8px; top: 8px; background: rgba(15,23,42,.7); color: #fff;
  font-size: .75rem; border-radius: 999px; padding: 2px 8px;
}

.field { display: block; border: 0; padding: 0; margin: 0 0 18px; }
.field > span, legend { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; }
input[type="text"], textarea, select {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: 3px solid rgba(31,59,255,.35); outline-offset: 1px;
}
.counter { display: block; text-align: right; color: var(--muted); font-size: .75rem; margin-top: 4px; }
.counter.over { color: var(--error); font-weight: 700; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--cobalt); flex: none; }
.check.disabled { opacity: .45; cursor: not-allowed; }

.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  flex: none; width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch input:checked + .track { background: var(--cobalt); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(31,59,255,.35); }
.commercial-options { margin: 10px 0 0 54px; }

.alert { border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; }
.alert.error { background: var(--error-bg); color: var(--error); }
.alert.info { background: var(--info-bg); color: var(--cobalt-ink); }
ul.alert { padding-left: 28px; }

.declaration { margin: 0 0 14px; }
.btn-wrap { display: inline-block; }
.btn {
  font: inherit; font-weight: 800; border: 0; border-radius: 999px; padding: 12px 28px;
  background: var(--cobalt); color: #fff; cursor: pointer;
}
.btn:disabled { background: #a5b4fc; cursor: not-allowed; pointer-events: none; }

.status { text-align: center; padding: 36px 20px; max-width: 520px; margin: 0 auto; }
.status-title { font-size: 1.3rem; margin: 12px 0 6px; }
.spinner {
  width: 38px; height: 38px; margin: 0 auto; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--cobalt); animation: spin 1s linear infinite;
}
.status.done .spinner { animation: none; border-color: var(--ok); }
.status.failed .spinner { animation: none; border-color: var(--error); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.foot { text-align: center; padding: 24px 16px 32px; }
