/* =========================================================
   Digi Gosticx: forms, pricing modal, cookie banner
   Source: .fld / .modal styles in the page boards,
   Home report form (design/boards/Home-Mixed.dc.html).
   Works in light and dark zones (uses zone tokens).
   ========================================================= */

/* ---------- Fields ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--tx2); }
.fld .opt { font-weight: 500; color: var(--tx3); }
.fld input, .fld select, .fld textarea {
  width: 100%; height: 52px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--ln); background: var(--bg); color: var(--tx);
  font-size: 16px; /* 16px stops iOS zoom on focus */
  font-weight: 500; transition: border-color .2s, box-shadow .2s;
}
.fld textarea { height: 96px; padding: 12px 14px; resize: vertical; }
.fld select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
}
.fld input::placeholder, .fld textarea::placeholder { color: var(--tx3); opacity: .8; }
.fld input:hover, .fld select:hover, .fld textarea:hover { border-color: color-mix(in srgb, var(--tx3) 60%, var(--ln)); }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: #7A2FD0; box-shadow: 0 0 0 3px rgba(122, 47, 208, .25); }
.th-dark .fld input, .th-dark .fld select, .th-dark .fld textarea { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
.th-dark .fld select option { background: #161618; color: #fff; }

/* Errors (set by site.js after a failed submit) */
.fld [aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); }
.fld-err { font-size: 12.5px; font-weight: 600; color: var(--bad); }
.fld-err:empty { display: none; }

/* Checkbox */
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--tx2); cursor: pointer; }
.chk input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #7A2FD0; cursor: pointer; }

/* DPDP consent line (shown under every form button) */
.consent { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--tx3); }
.consent a { color: var(--acc); }

.form-ticks { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--tx3); }
.form-ticks li::before { content: "✓ "; }

/* Glass card (dark zones) */
.glass {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); padding: 30px;
}
.th-light .glass { background: var(--pn); border-color: var(--ln); box-shadow: var(--sh); }

/* Two-step form */
.steps { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--tx3); }
.steps i { width: 10px; height: 10px; border-radius: 50%; background: var(--ln); flex: none; transition: background .3s; }
.steps i.on { background: linear-gradient(135deg, #2457C9, #C42A6B); }
.steps .bar { flex: 1; height: 1px; background: var(--ln); }
.fstep[hidden] { display: none; }
.fstep { animation: dg-step .35s var(--ease) both; }
@keyframes dg-step { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* Success state */
.form-ok { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; animation: dg-step .35s var(--ease) both; }
.form-ok[hidden] { display: none; }
.ok-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #2457C9, #C42A6B); color: #fff; font-size: 24px; font-weight: 800;
}
.form-ok h3, .form-ok .h3 { margin: 0; font-family: var(--f-head); font-size: 24px; }
.form-ok p { margin: 0; color: var(--tx2); font-size: 15.5px; line-height: 1.6; }

/* ---------- Pricing modal (native <dialog>) ---------- */
.modal {
  width: min(520px, calc(100vw - 32px)); max-height: 92vh; padding: 30px; margin: auto;
  border-radius: 26px; border: 1px solid var(--ln); background: var(--pn); color: var(--tx);
  box-shadow: var(--sh); overflow: auto;
}
.modal[open] { animation: dg-rise .35s var(--ease) both; }
.modal::backdrop { background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes dg-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal-t { margin: 0; font-family: var(--f-head); font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.modal-d { margin: 6px 0 0; color: var(--tx2); font-size: 14.5px; line-height: 1.55; }
html.modal-lock { overflow: hidden; }

/* ---------- Cookie banner ---------- */
.ck {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  max-width: 560px; margin-left: auto;
  border-radius: 22px; border: 1px solid #26262B; background: rgba(17, 17, 20, .94);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); padding: 22px; color: #fff;
  animation: dg-rise .45s var(--ease) both;
}
.ck[hidden] { display: none; }
.ck-t { margin: 0; font-family: var(--f-head); font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.ck-d { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--tx2); }
.ck-d a { color: var(--acc); }
.ck-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ck-btns .btn { height: 44px; padding: 0 18px; font-size: 14px; border-radius: 12px; flex: 1 1 auto; }
.ck-prefs { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--ln); padding-top: 8px; }
.ck-prefs[hidden] { display: none; }
.ck-opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.ck-opt b { display: block; font-size: 14px; }
.ck-opt span { display: block; font-size: 12.5px; color: var(--tx3); line-height: 1.45; }

/* Toggle switch */
.ck .sw { position: relative; flex: none; width: 46px; height: 26px; }
.ck .sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.ck .sw i { position: absolute; inset: 0; border-radius: 999px; background: #3A3A42; transition: background .2s; }
.ck .sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.ck .sw input:checked + i { background: linear-gradient(110deg, #2457C9, #7A2FD0); }
.ck .sw input:checked + i::after { transform: translateX(20px); }
.ck .sw input:disabled { cursor: not-allowed; }
.ck .sw input:disabled + i { opacity: .6; }
.ck .sw input:focus-visible + i { outline: 2px solid #C4B5FD; outline-offset: 2px; }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .glass { padding: 20px; }
  .modal { padding: 22px; }
  .ck { left: 8px; right: 8px; bottom: 8px; padding: 18px; }
}
