/* Startax public forms — brand kit layout (band + card) */
@font-face {
  font-family: "NAMU 1960";
  src: url("/static/fonts/NAMU-1960.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fixel";
  src: url("/static/fonts/FixelText-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fixel";
  src: url("/static/fonts/FixelText-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fixel";
  src: url("/static/fonts/FixelText-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fixel";
  src: url("/static/fonts/FixelText-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #020105;
  --black: #000;
  --lime: #e1ff84;
  --bg: #f2f4ec;
  --card: #fff;
  --muted: #646a5f;
  --line: rgba(0, 0, 0, 0.14);
  --soft: rgba(0, 0, 0, 0.06);
  --error: #d92d20;
  --error-bg: #fdecea;
  --display: "NAMU 1960", Fixel, system-ui, sans-serif;
  --text: Fixel, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* aliases for older class hooks */
  --stx-ink: var(--ink);
  --stx-lime: var(--lime);
  --foreground: var(--ink);
  --muted-foreground: var(--muted);
  --border: var(--line);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px / 1.5 var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

::selection {
  background: var(--lime);
  color: var(--ink);
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Black band --- */
.band {
  background: var(--black);
  color: #fff;
  padding-bottom: 96px;
  border-radius: 0 0 40px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.logo img {
  height: 28px;
  display: block;
}

.band .logo img {
  filter: invert(1);
}

.partner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 6px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.partner img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background: #020105;
}

.hero {
  padding: 16px 0 0;
}

.eyebrow {
  color: var(--lime);
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 10px;
}

.hero h1 {
  font: 400 clamp(28px, 4.8vw, 40px) / 1.1 var(--display);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  color: #fff;
}

.hero p.lead,
.hero .lead {
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  margin: 0;
  max-width: 560px;
}

.band + .wrap .card {
  margin-top: -64px;
  position: relative;
}

/* --- Card --- */
.card {
  background: var(--card);
  border-radius: 32px;
  padding: 36px 32px 28px;
  margin: 16px 0 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.card-head h2 {
  font: 400 26px / 1.15 var(--display);
  margin: 0;
}

.card-head span {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

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

.field {
  padding: 20px 0;
  border-top: 1px solid var(--soft);
}

.field:first-of-type {
  border-top: 0;
}

.field-label {
  display: block;
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 10px;
}

.req {
  color: var(--error);
  margin-left: 2px;
}

.hint,
.field-hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
  line-height: 1.45;
}

/* підказка одразу після label — трохи ближче до заголовка поля */
.field-label + .hint,
.field-label + .field-hint {
  margin: 2px 0 12px;
}

/* підказка після інпута / блоку файлу */
.input + .hint,
.input + .field-hint,
.file-upload + .hint,
.file-upload + .field-hint,
.pills + .hint {
  margin: 10px 0 0;
}

.input {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 1.33px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  font: 400 16px var(--text);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: #9a9f95;
}

.input:hover {
  border-color: rgba(0, 0, 0, 0.3);
}

.input:focus {
  outline: none;
  background: #fff;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(225, 255, 132, 0.9);
}

/* Pills */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  position: relative;
}

.pill input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.pill span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 28px;
  border: 1.33px solid var(--line);
  background: var(--bg);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.pill:hover span {
  border-color: var(--ink);
}

.pill input:checked + span {
  background: var(--black);
  border-color: var(--black);
  color: var(--lime);
}

.pill input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(225, 255, 132, 0.9);
  border-color: var(--ink);
}

.seg .pill span {
  min-width: 96px;
  justify-content: center;
}

.other-row {
  display: none;
  margin-top: 12px;
}

.other-row.show {
  display: block;
}

/* Довгі варіанти (B2C тарифи) */
.stack-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-options .option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1.33px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  font: 500 14px/1.35 var(--text);
  color: var(--ink);
}

.stack-options .option input {
  margin-top: 3px;
  flex-shrink: 0;
}

.stack-options .option:has(input:checked) {
  border-color: var(--black);
  background: var(--bg);
}

.field.invalid .stack-options .option {
  border-color: rgba(217, 45, 32, 0.45);
}

/* Errors — support both .visible (legacy JS) and .field.invalid */
.field-error {
  display: none;
  color: var(--error);
  font-size: 14px;
  margin: 8px 0 0;
}

.field-error.visible,
.field.invalid .field-error {
  display: block;
}

.field.invalid .input,
.input.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.field.invalid .pill span {
  border-color: rgba(217, 45, 32, 0.5);
}

/* Actions */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--soft);
  margin-top: 4px;
}

.btn {
  height: 52px;
  padding: 0 26px;
  border-radius: 28px;
  font: 600 15px var(--text);
  cursor: pointer;
  border: 1.33px solid var(--black);
  transition: transform 0.1s, background 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn-ghost,
.btn-secondary {
  background: var(--bg);
  color: var(--black);
}

.btn-ghost:hover,
.btn-secondary:hover {
  background: #e6e9dc;
}

.btn-primary {
  background: var(--black);
  color: var(--lime);
  min-width: 180px;
}

.btn-primary:hover {
  background: #161616;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(225, 255, 132, 0.9);
}

.btn-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(225, 255, 132, 0.3);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* Toast / form messages */
.toast,
.form-msg {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
}

.toast.visible,
.form-msg.show {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-error,
.form-msg {
  background: var(--error-bg);
  color: var(--error);
}

.toast-success {
  background: #eaf7d4;
  color: #2f5b0c;
}

.toast-loading {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
}

.success {
  display: none;
  text-align: center;
  padding: 24px 0 8px;
}

.success.show {
  display: block;
}

.success .tick {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--lime);
  display: grid;
  place-items: center;
}

.success .tick svg {
  width: 30px;
  height: 30px;
}

.success h2 {
  font: 400 30px / 1.1 var(--display);
  margin: 0 0 10px;
}

.success p {
  color: var(--muted);
  margin: 0 0 22px;
}

footer,
.site-footer {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 28px 0 36px;
}

/* --- FOP extras: file upload --- */
.file-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.75rem;
  padding: 1rem;
  border: 1.33px dashed var(--line);
  border-radius: 16px;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.file-upload:hover {
  border-color: rgba(0, 0, 0, 0.3);
}

.file-upload.dragover {
  border-color: var(--ink);
  border-style: solid;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(225, 255, 132, 0.9);
}

.file-upload.has-file {
  border-style: solid;
  border-color: var(--ink);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 28px;
  background: var(--black);
  color: var(--lime);
  font: 600 14px var(--text);
  cursor: pointer;
}

.file-placeholder,
.file-name {
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
}

.file-name {
  color: var(--ink);
  font-weight: 500;
}

.file-drop-hint {
  width: 100%;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.field.invalid .file-upload,
.file-upload.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

/* ECP panels */
.ecp-panel {
  display: none;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
  flex-direction: column;
  gap: 0.65rem;
}

.ecp-panel.visible {
  display: flex;
}

.ecp-panel h3 {
  margin: 0;
  font: 400 1.05rem / 1.2 var(--display);
}

.ecp-panel p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

.ecp-panel a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ecp-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.ecp-list li {
  margin-bottom: 0.35rem;
}

.ecp-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.ecp-check input {
  margin-top: 0.2rem;
  accent-color: var(--lime);
}

/* Loading overlay (fop file upload) */
.form-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 1, 5, 0.45);
  padding: 1rem;
}

.form-loading-overlay.visible {
  display: flex;
}

.form-loading-card {
  background: #fff;
  border-radius: 24px;
  padding: 1.5rem 1.75rem;
  max-width: 22rem;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.form-loading-spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.85rem;
  border: 3px solid rgba(2, 1, 5, 0.12);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.form-loading-title {
  margin: 0 0 0.35rem;
  font: 400 1.15rem / 1.2 var(--display);
}

.form-loading-text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .hero {
    padding: 8px 0 0;
  }

  .band {
    padding-bottom: 80px;
    border-radius: 0 0 28px 28px;
  }

  .band + .wrap .card {
    margin-top: -56px;
  }

  .card {
    padding: 26px 20px 22px;
    border-radius: 24px;
  }

  .card-head h2 {
    font-size: 22px;
  }

  .actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .partner span {
    display: none;
  }

  .partner {
    padding: 0 6px;
  }
}
