/* ============================================================
   ZehnProtect — So'rovnoma sayti
   Kali Linux (kali.org) ilhomi: chuqur ko'k, elektr ko'k urg'u
   Light / Dark mavzular
   ============================================================ */

:root {
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 18px 40px rgba(0, 0, 0, 0.18);
  --transition-fast: 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-mid: 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-sans: "Inter", "Segoe UI", "Roboto", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- DARK (default) — Kali poligoni ---------- */
:root,
:root[data-theme="dark"] {
  --bg-0: #0b0f17;
  --bg-1: #10151f;
  --bg-2: #161c28;
  --bg-3: #1c2433;
  --surface: rgba(22, 28, 40, 0.85);
  --surface-elev: rgba(28, 36, 51, 0.92);
  --border: rgba(80, 110, 160, 0.22);
  --border-strong: rgba(120, 160, 220, 0.4);

  --text-primary: #e6edf7;
  --text-secondary: #aab4c5;
  --text-muted: #7a8597;

  --accent: #367bf0;          /* Kali elektrik ko'k */
  --accent-strong: #1f5fd0;
  --accent-soft: rgba(54, 123, 240, 0.14);
  --accent-glow: rgba(54, 123, 240, 0.45);

  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  --header-bg: rgba(11, 15, 23, 0.78);
  --grid-line: rgba(54, 123, 240, 0.08);
}

/* ---------- LIGHT ---------- */
:root[data-theme="light"] {
  --bg-0: #f3f6fb;
  --bg-1: #ffffff;
  --bg-2: #f7fafd;
  --bg-3: #eef3fa;
  --surface: rgba(255, 255, 255, 0.95);
  --surface-elev: #ffffff;
  --border: rgba(20, 50, 100, 0.12);
  --border-strong: rgba(20, 50, 100, 0.28);

  --text-primary: #0f1a2e;
  --text-secondary: #475569;
  --text-muted: #6b7686;

  --accent: #1f5fd0;
  --accent-strong: #143f99;
  --accent-soft: rgba(31, 95, 208, 0.10);
  --accent-glow: rgba(31, 95, 208, 0.25);

  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;

  --header-bg: rgba(255, 255, 255, 0.86);
  --grid-line: rgba(31, 95, 208, 0.07);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-0);
  background-image:
    radial-gradient(1100px 600px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--accent-soft), transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
  line-height: 1.55;
  transition: background-color var(--transition-mid), color var(--transition-mid);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-strong);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand__logo {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 4px 10px var(--accent-glow));
}

.brand__name {
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 1.15rem;
}

.brand__name span {
  color: var(--accent);
}

.brand__tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 2px;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ============================================================
   Main layout
   ============================================================ */
main {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ============================================================
   Hero (landing)
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  padding: 28px 0 16px;
}

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.hero__eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.hero__title {
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 18px 0 14px;
}
.hero__title span {
  background: linear-gradient(120deg, var(--accent), #67a2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
}

@media (max-width: 880px) {
  .hero__desc { margin-left: auto; margin-right: auto; }
}

.hero__cta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 880px) {
  .hero__cta { justify-content: center; }
}

.hero__shield {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__shield img {
  width: min(360px, 80%);
  filter: drop-shadow(0 30px 60px var(--accent-glow));
  animation: floaty 6s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ---------- Feature pills (under hero) ---------- */
.features {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 760px) {
  .features { grid-template-columns: 1fr; }
}

.feature-card {
  padding: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  transition: all var(--transition-mid);
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}
.feature-card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}
.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.feature-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  user-select: none;
}
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--accent-glow);
  color: #fff;
}
.btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn--ghost:hover {
  border-color: var(--border-strong);
  color: var(--accent);
}
.btn--google {
  background: var(--surface-elev);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn--google:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.btn--google img,
.btn--google svg {
  width: 18px;
  height: 18px;
}

.btn .arrow {
  transition: transform var(--transition-fast);
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* ============================================================
   Auth panel (sign-in card on landing)
   ============================================================ */
.auth-panel {
  margin-top: 32px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 460px;
}
.auth-panel__row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.auth-panel__row strong {
  color: var(--text-primary);
}
.auth-status {
  font-size: 0.86rem;
  color: var(--text-muted);
}
.auth-status.is-error { color: var(--danger); }
.auth-status.is-ok    { color: var(--success); }

@media (max-width: 880px) {
  .auth-panel { margin-left: auto; margin-right: auto; }
}

/* ============================================================
   Survey page
   ============================================================ */
.survey-header {
  margin-bottom: 24px;
  padding: 28px 30px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 70%),
    var(--surface);
}

.survey-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.3px;
}

.survey-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: 880px;
}

.user-banner {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}
.user-banner__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
}
.user-banner__email {
  font-weight: 600;
  color: var(--text-primary);
}
.user-banner__switch {
  margin-left: auto;
  font-size: 0.86rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.user-banner__switch:hover {
  border-color: var(--border-strong);
  color: var(--accent);
}

/* ---------- Progress bar ---------- */
.progress {
  position: sticky;
  top: 72px;
  z-index: 50;
  margin: 18px 0 24px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-elev);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.progress__bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #67a2ff);
  border-radius: 999px;
  transition: width 250ms ease;
}
.progress__label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---------- Question card ---------- */
.question-card {
  padding: 24px 26px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  transition: border-color var(--transition-fast);
}
.question-card:hover {
  border-color: var(--border-strong);
}
.question-card.is-answered {
  border-left: 3px solid var(--success);
}
.question-card.is-error {
  border-color: var(--danger);
}

.question-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.question-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 16px;
  line-height: 1.5;
}
.question-card__title .required {
  color: var(--danger);
  margin-left: 4px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.option:hover {
  border-color: var(--border-strong);
  background: var(--bg-3);
}
.option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  margin: 0;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}
.option input[type="radio"]:checked {
  border-color: var(--accent);
}
.option input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.option-text {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.other-input {
  margin-top: 8px;
  margin-left: 30px;
  display: none;
}
.option--other:has(input:checked) ~ .other-input {
  display: block;
}
.other-input input,
.other-input textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-1);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.other-input input:focus,
.other-input textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Submit area ---------- */
.submit-row {
  margin-top: 28px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.submit-row__info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.error-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 0.92rem;
  display: none;
}
.error-banner.is-visible { display: block; }

/* ============================================================
   Thanks page
   ============================================================ */
.thanks {
  max-width: 640px;
  margin: 60px auto;
  text-align: center;
  padding: 48px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
}
.thanks__check {
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #67a2ff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px var(--accent-glow);
  animation: pop 500ms cubic-bezier(0.2, 1.4, 0.6, 1);
}
.thanks__check svg {
  width: 42px;
  height: 42px;
  color: #fff;
}
@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.thanks h1 {
  font-size: 1.8rem;
  margin: 0 0 8px;
}
.thanks p {
  color: var(--text-secondary);
  margin: 0 0 28px;
}

/* ============================================================
   Loading overlay
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 23, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
:root[data-theme="light"] .overlay {
  background: rgba(243, 246, 251, 0.8);
}
.overlay.is-visible {
  display: flex;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 60px;
}
.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--accent); }
