*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
html, body {
  width: 100%;
  min-height: 100%;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.icon {
  width: 1em; height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-fill { fill: currentColor; stroke: none; }

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  user-select: none;
}
.brand-tile {
  width: 32px; height: 32px;
  border-radius: .4rem;
  object-fit: cover;
  background: #0b1220;
  flex-shrink: 0;
}
.brand-word {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .02em;
  background: linear-gradient(135deg, #00CAE0, #60F0FF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
html[data-theme="light"] .brand-word {
  background: linear-gradient(135deg, #00A1C2, #00CAE0);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border-radius: 999px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease, filter .18s ease;
  user-select: none;
}
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--w-6);
  border-radius: .45rem;
  padding: .4rem .85rem;
  font-size: .8rem;
  font-weight: 500;
}
.btn-ghost:hover {
  color: var(--color-primary);
  border-color: #00cae040;
  background: #00cae00d;
}
.btn-solid {
  background: var(--color-primary);
  color: #fff;
  border: 1px solid transparent;
  padding: .45rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  box-shadow: var(--glow);
  border-radius: 999px;
}
.btn-solid:hover {
  box-shadow: 0 0 1.4rem rgba(0, 202, 224, .45);
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid rgba(0, 202, 224, .55);
  padding: .42rem .95rem;
  font-size: .8rem;
  font-weight: 500;
  border-radius: 999px;
}
.btn-outline:hover {
  background: var(--c-primary-10);
  box-shadow: 0 0 .8rem rgba(0, 202, 224, .25);
}
.btn-gold {
  background: linear-gradient(180deg, #F7D25A, #E8B000);
  color: #2a2208;
  border: 1px solid rgba(255, 220, 100, .35);
  box-shadow: 0 0 .7rem rgba(245, 197, 66, .28);
  font-weight: 600;
}
.btn-gold:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-sky {
  background: linear-gradient(180deg, #6BA8FF, #4C8DFF);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 0 .7rem rgba(91, 156, 255, .3);
  font-weight: 600;
}
.btn-sky:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* Marketing header */
.m-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
}
.m-header.is-scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(1.43rem);
  -webkit-backdrop-filter: blur(1.43rem);
  border-bottom-color: rgba(0, 202, 224, .06);
}
.m-header-nav { display: flex; align-items: center; gap: .55rem; }

/* Floating chat */
.fab-chat {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 90;
  width: 3.25rem; height: 3.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 1.4rem rgba(0, 202, 224, .45), 0 .5rem 1.25rem rgba(0,0,0,.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.fab-chat:hover { transform: translateY(-2px) scale(1.04); }
.fab-chat svg { width: 1.4rem; height: 1.4rem; }

/* Toast */
#toast-root { position: fixed; top: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 10050; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast {
  pointer-events: auto;
  min-width: 16rem;
  max-width: 26rem;
  padding: .7rem 1rem;
  border-radius: .7rem;
  background: rgba(28, 30, 34, .96);
  border: 1px solid var(--w-10);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  display: flex; align-items: center; gap: .5rem;
  animation: toast-in .25s ease;
}
html[data-theme="light"] .toast,
.theme-light .toast {
  background: #fff;
  color: #0F1419;
  border-color: rgba(0,0,0,.08);
}
.toast-ok { border-color: rgba(0, 229, 160, .35); }
.toast-warn { border-color: rgba(245, 197, 66, .4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Modal overlay */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-overlay.is-open { display: flex; }
.modal-overlay.is-open .modal-card { animation: modal-in .28s cubic-bezier(.22,1,.36,1); }
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Form bits shared */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.field label { font-size: .8rem; color: var(--text-secondary); }
.field .req { color: #ef4444; margin-right: .15rem; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--w-10);
  background: var(--bg-input);
  border-radius: .5rem;
  padding: .6rem .75rem;
  font-size: .875rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--c-primary-40);
  box-shadow: 0 0 0 3px var(--c-primary-10);
}
.textarea { resize: vertical; min-height: 6rem; }
.input-row { display: flex; gap: .5rem; align-items: stretch; }
.input-row .input { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  border: 1px solid var(--c-primary-30);
  color: var(--color-primary);
  background: var(--c-primary-8);
  white-space: nowrap;
}

/* Captcha canvas */
.captcha-box {
  display: flex; align-items: center; gap: .5rem;
}
.captcha-img {
  height: 38px; min-width: 96px;
  border-radius: .4rem;
  border: 1px solid var(--w-10);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: .15em;
  font-weight: 700;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  color: #222;
  user-select: none;
  font-style: italic;
}

/* Utility */
.hidden { display: none !important; }
.text-cyan { color: var(--color-primary); }
.text-sec { color: var(--text-secondary); }
.text-muted { color: var(--text-tertiary); }

@media (max-width: 900px) {
  .m-header { padding: 0 1rem; }
  .m-header .btn-ghost span, .m-header .btn-outline span:not(.keep) { }
}
