:root {
  --bg: #f4f8ff;
  --surface: #ffffff;
  --surface-soft: #eaf2ff;
  --text: #102030;
  --muted: #4d6270;
  --primary: #1572ff;
  --primary-strong: #0b57d0;
  --accent: #00a57d;
  --warn: #b03f3f;
  --border: #c9d8ea;
  --shadow: 0 14px 40px rgba(16, 32, 48, 0.12);
  --radius: 18px;
}

:root[data-theme="dark"] {
  --bg: #0d1420;
  --surface: #0f1a28;
  --surface-soft: #111f31;
  --text: #edf4ff;
  --muted: #adc0d7;
  --primary: #5aa2ff;
  --primary-strong: #3c84ee;
  --accent: #18d0a3;
  --warn: #ff9696;
  --border: #24364d;
  --shadow: 0 16px 42px rgba(2, 8, 18, 0.55);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, #7bd2ff55, transparent 28%),
    radial-gradient(circle at 88% 0%, #8ff2c566, transparent 28%),
    var(--bg);
  line-height: 1.45;
}

a { color: var(--primary); }
.container { width: min(1120px, calc(100% - 1.8rem)); margin: 0 auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-wrap {
  min-height: 66px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: .03em; }
.brand span { color: var(--primary); }
nav { display: flex; flex-wrap: wrap; gap: .55rem; }
.nav-link { text-decoration: none; padding: .5rem .8rem; border-radius: 999px; }
.nav-link:hover, .nav-link:focus-visible { background: var(--surface-soft); }
.theme-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .48rem .68rem; display: inline-flex; gap: .4rem; align-items: center; }

main { width: min(1120px, calc(100% - 1.4rem)); margin: 1.2rem auto 4rem; display: grid; gap: 1rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  animation: fadeup .35s ease both;
}
.hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: .2rem 0 0; }
.eyebrow { color: var(--primary); margin: 0; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.intro { margin-bottom: 1rem; color: var(--muted); max-width: 60ch; }
.privacy-claim { font-weight: 700; color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; align-items: end; }
.field { display: grid; gap: .35rem; }
.field span { color: var(--muted); }
label, legend { font-weight: 600; }
input, select, .wifi-string-box {
  width: 100%;
  border-radius: 12px;
  padding: .7rem .8rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary), white 20%); outline-offset: 2px; }
.checkbox-field { display: inline-flex; align-items: center; gap: .45rem; grid-column: span 2; }
.palette { grid-column: span 2; border: 1px dashed var(--border); border-radius: 12px; padding: .7rem; display: grid; grid-template-columns: 100px 1fr; gap: .4rem; }
.palette legend { padding: 0 .35rem; }
.palette input[type="color"] { width: 56px; height: 34px; padding: 0; border: 0; background: transparent; }
.actions { grid-column: span 2; display: flex; flex-wrap: wrap; gap: .5rem; }
button {
  border: 0;
  padding: .72rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-primary { background: linear-gradient(120deg, var(--primary), var(--primary-strong)); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.warning { color: var(--warn); margin: .4rem 0 0; min-height: 1.25rem; }
.status { margin-top: .8rem; min-height: 1.2rem; }
.result-wrap[hidden] { display: none; }
.qr-preview { display: grid; gap: .6rem; }
#qrcode-canvas { background: white; border-radius: 8px; max-width: 100%; width: min(360px, 100%); height: auto; }
.qrcode-svg { width: min(360px, 100%); overflow: auto; }
.qrcode-svg svg { width: 100%; }
.wifi-string-box { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; padding: .7rem; min-height: 5.1rem; white-space: pre-wrap; word-break: break-all; }
.steps { padding-left: 1.2rem; }
.faq-list details { border-top: 1px dashed var(--border); padding: .45rem 0; }
.links-grid { display: grid; list-style: none; padding: 0; margin: .6rem 0 0; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem; }
.links-grid a { display: block; padding: .7rem; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; }
.site-footer { background: color-mix(in srgb, var(--surface) 88%, transparent); border-top: 1px solid var(--border); padding: 1rem 0; color: var(--muted); }
.site-footer a { color: var(--muted); }
.content li, .content p { max-width: 70ch; }
.content h2 { margin-top: 1.2rem; }
.contact-list { list-style: none; padding: 0; }

@media (max-width: 780px) {
  .form-grid { grid-template-columns: 1fr; }
  .checkbox-field, .palette, .actions { grid-column: span 1; }
  .actions { flex-direction: column; }
  nav { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.reveal { animation: fadeup .45s cubic-bezier(.16,.75,.32,1); }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: translateY(0);} }
/* Related tools */
.seo-link-block { color-scheme: light; margin-top: 4rem; padding: 3.25rem 1.25rem; color: #173328; background: #f2f7f4; border-block: 1px solid #dce8e1; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.seo-link-block * { box-sizing: border-box; }
.seo-link-block__inner { width: min(1120px, 100%); margin: 0 auto; }
.seo-link-block header { margin-bottom: 1.5rem; }
.seo-link-block header p { margin: 0 0 .4rem; color: #257050; font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.seo-link-block header h2 { margin: 0; color: #173328; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.15; letter-spacing: -.035em; }
.seo-link-block ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin: 0; padding: 0; list-style: none; }
.seo-link-block li { min-width: 0; }
.seo-link-block a { display: flex; min-height: 3.8rem; height: 100%; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; color: #25463a; background: #fff; border: 1px solid #dce8e1; border-radius: .75rem; font-size: .88rem; font-weight: 700; line-height: 1.35; text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.seo-link-block a span { flex: 0 0 auto; color: #2d815d; font-size: 1rem; }
.seo-link-block a:hover { color: #0d5c3b; border-color: #78ad94; box-shadow: 0 8px 22px rgba(23, 51, 40, .08); transform: translateY(-2px); }
.seo-link-block a:focus-visible { outline: 3px solid rgba(45, 129, 93, .3); outline-offset: 3px; }
@media (max-width: 800px) { .seo-link-block ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .seo-link-block { padding: 2.5rem 1rem; } .seo-link-block ul { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .seo-link-block a { transition: none; } }
