/* ==========================================================================
   Rocky County RP — main stylesheet
   Theme: black / deep red / light red accent
   --------------------------------------------------------------------------
   LOGO: the site logo is referenced ONLY here (--logo). To use your own logo,
   overwrite assets/img/logo.png (square, transparent PNG recommended, ~512px)
   or point --logo at another file.
   ========================================================================== */
:root {
  --logo: url("../img/logo.png");

  --bg: #0a0a0b;
  --bg-2: #0f0f11;
  --surface: #141417;
  --surface-2: #1b1b20;
  --surface-3: #232329;
  --border: #2a2a31;
  --border-strong: #3a3a44;

  --primary: #b3121b;
  --primary-hover: #d0161f;
  --primary-dark: #7a0b12;
  --accent: #ff6b6b;
  --accent-soft: #ffb3b3;

  --text: #f3f3f5;
  --text-2: #c9c9d1;
  --muted: #9a9aa6;

  --success: #3ddc84;
  --warning: #ffc857;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-red: 0 10px 34px rgba(179, 18, 27, .35);
  --container: 1180px;
  --header-h: 72px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Rajdhani", "Oswald", "Bebas Neue", "Segoe UI", system-ui, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(179, 18, 27, .12), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(179, 18, 27, .06), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-soft); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
code { font-family: var(--mono); font-size: .92em; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 22px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; color: #fff; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Logo (single source: --logo) ---------- */
.logo-img {
  display: inline-block;
  background: var(--logo) center / contain no-repeat;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .8em 1.4em;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--text);
  font: inherit; font-weight: 700; font-size: .98rem; letter-spacing: .01em;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s, color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); color: #fff; }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.btn-primary { background: linear-gradient(180deg, var(--primary-hover), var(--primary)); color: #fff; box-shadow: var(--shadow-red); }
.btn-primary:hover { background: linear-gradient(180deg, #e21b25, var(--primary-hover)); box-shadow: 0 12px 38px rgba(208, 22, 31, .5); }
.btn-outline { background: rgba(255, 255, 255, .02); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); background: rgba(255, 107, 107, .08); }
.btn-ghost { background: transparent; color: var(--accent); padding-left: 0; padding-right: 0; }
.btn-ghost:hover { color: var(--accent-soft); transform: none; }
.btn-discord { background: #5865F2; color: #fff; box-shadow: 0 10px 30px rgba(88, 101, 242, .3); }
.btn-discord:hover { background: #6a76ff; }
.btn-lg { padding: 1em 1.7em; font-size: 1.05rem; }
.btn-sm { padding: .55em 1.05em; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 11, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--primary), transparent); opacity: .7; }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .logo-img { width: 118px; height: 58px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { white-space: nowrap; font-family: var(--font-display); font-size: 1.22rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.brand-text small { white-space: nowrap; font-size: .72rem; color: var(--accent); letter-spacing: .32em; text-transform: uppercase; font-weight: 700; }

.site-nav { display: flex; align-items: center; gap: 14px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav-list > li { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 13px; border-radius: 10px;
  color: var(--text-2); font: inherit; font-weight: 600; font-size: .95rem;
  background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.nav-link:hover, .has-dropdown.open > .nav-link { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-link[aria-current="page"], .nav-link.active { color: #fff; }
.nav-link[aria-current="page"]::after, .nav-link.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent);
}
.nav-link .chev { width: 14px; height: 14px; transition: transform .2s; opacity: .8; }
.has-dropdown.open > .nav-link .chev { transform: rotate(180deg); }

.dropdown {
  list-style: none; margin: 0; padding: 8px;
  position: absolute; top: calc(100% + 10px); left: 50%;
  min-width: 250px;
  background: rgba(20, 20, 23, .98);
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden;
  transform: translate(-50%, 6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.dropdown::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; } /* hover bridge */
.has-dropdown.open > .dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (hover: hover) and (min-width: 981px) {
  .has-dropdown:hover > .dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
  .has-dropdown:hover > .nav-link .chev { transform: rotate(180deg); }
}
.dropdown a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 8px;
  color: var(--text-2); font-weight: 600; font-size: .94rem;
}
.dropdown a:hover, .dropdown a:focus-visible { background: rgba(179, 18, 27, .16); color: #fff; }
.dropdown a[aria-current="page"] { background: rgba(179, 18, 27, .22); color: #fff; }
.dropdown .dd-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); flex-shrink: 0; }
.dropdown .dd-icon svg { width: 17px; height: 17px; }
.dropdown .dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dropdown .dd-all { font-size: .85rem; color: var(--muted); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1300px) {
  .nav-link { padding: 9px 9px; font-size: .92rem; }
  .site-nav { gap: 10px; }
  .nav-link[aria-current="page"]::after, .nav-link.active::after { left: 9px; right: 9px; }
}
@media (max-width: 980px) {
  /* backdrop-filter would make the fixed menu panel relative to the header, so use a solid bar on mobile */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10, 10, 11, .97); }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
    flex-direction: column; align-items: stretch; gap: 16px;
    padding: 18px 22px 40px;
    background: rgba(10, 10, 11, .985);
    overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-open .site-nav { opacity: 1; visibility: visible; transform: none; }
  .nav-open { overflow: hidden; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-link { width: 100%; justify-content: space-between; padding: 14px 14px; font-size: 1.05rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
  .nav-link[aria-current="page"]::after, .nav-link.active::after { display: none; }
  .nav-link[aria-current="page"], .nav-link.active { border-color: var(--primary); }
  .dropdown {
    position: static; transform: none; min-width: 0; margin: 4px 0 6px;
    opacity: 1; visibility: visible; display: none;
    border-top-width: 1px; box-shadow: none; background: var(--bg-2);
  }
  .dropdown::before { display: none; }
  .has-dropdown.open > .dropdown { display: block; transform: none; }
  .nav-cta { width: 100%; padding: 14px; font-size: 1.05rem; }
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; position: relative; }
.section-sm { padding: 56px 0; }
.section-alt { background: linear-gradient(180deg, rgba(20, 20, 23, .7), rgba(15, 15, 17, .7)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }
.section-head p { color: var(--text-2); font-size: 1.08rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--primary); border-radius: 2px; }
.section-head.center .eyebrow::after, .section-head:not(.left) .eyebrow::after { content: ""; width: 26px; height: 2px; background: var(--primary); border-radius: 2px; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; overflow: hidden; padding: 96px 0 104px; border-bottom: 1px solid var(--border); }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 10, 11, 0) 60%, var(--bg) 100%),
    radial-gradient(800px 480px at 78% 30%, rgba(179, 18, 27, .38), transparent 65%),
    radial-gradient(600px 400px at 10% 90%, rgba(255, 107, 107, .10), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 14px),
    var(--bg);
}
.hero-bg::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 180px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 180' preserveAspectRatio='none'%3E%3Cpath d='M0 180 L0 120 L120 70 L220 110 L360 30 L470 95 L560 60 L700 120 L820 40 L960 105 L1060 65 L1180 115 L1300 50 L1440 100 L1440 180 Z' fill='%23140709'/%3E%3Cpath d='M0 180 L0 150 L160 110 L300 140 L420 95 L560 145 L720 100 L860 150 L1000 115 L1150 150 L1300 110 L1440 140 L1440 180 Z' fill='%230a0a0b'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
.hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 56px; align-items: center; }
.hero h1 { font-family: var(--font-display); font-size: clamp(2.8rem, 7vw, 5.2rem); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: .98; margin-bottom: 20px; text-shadow: 0 6px 40px rgba(179, 18, 27, .35); }
.hero h1 .text-accent { background: linear-gradient(180deg, #ff8a8a, var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-2); max-width: 580px; margin-bottom: 30px; }
.hero .btn-row { margin-bottom: 22px; }

.connect-box {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 8px 8px 14px; border-radius: 12px;
  background: rgba(0, 0, 0, .45); border: 1px dashed var(--border-strong);
  max-width: 100%;
}
.connect-label { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.connect-box code { color: var(--accent-soft); font-size: .98rem; word-break: break-all; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.copy-btn:hover { border-color: var(--accent); color: #fff; }
.copy-btn.copied { background: rgba(61, 220, 132, .12); border-color: var(--success); color: var(--success); }
.copy-btn svg { width: 15px; height: 15px; }

/* ---------- Server status card ---------- */
.status-card {
  position: relative;
  background: linear-gradient(180deg, rgba(27, 27, 32, .92), rgba(15, 15, 17, .95));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
}
.status-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary)); }
.status-card .hero-logo { width: 240px; height: 200px; display: block; margin: 0 auto 18px; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .45)); }
.status-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.status-title { font-size: .78rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-strong);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.status-card[data-state="loading"] .status-dot { animation: pulse 1.2s infinite ease-in-out; }
.status-card[data-state="online"] .status-pill { color: var(--success); border-color: rgba(61, 220, 132, .4); background: rgba(61, 220, 132, .08); }
.status-card[data-state="online"] .status-dot { background: var(--success); box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: ping 2s infinite; }
.status-card[data-state="offline"] .status-pill { color: var(--accent-soft); border-color: rgba(255, 107, 107, .35); background: rgba(179, 18, 27, .12); }
.status-card[data-state="offline"] .status-dot { background: var(--accent); }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .55); } 70% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }
.status-players { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px; }
.status-count { font-family: var(--font-display); font-size: 3rem; font-weight: 800; line-height: 1; }
.status-max { color: var(--muted); font-size: 1.1rem; font-weight: 600; }
.status-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-bottom: 14px; }
.status-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: inherit; transition: width .6s ease; }
.status-note { font-size: .85rem; color: var(--muted); margin: 0 0 16px; min-height: 1.4em; }
.status-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: .9rem; }
.status-meta dt { color: var(--muted); }
.status-meta dd { margin: 0; text-align: right; color: var(--text-2); font-weight: 600; word-break: break-all; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-5 { grid-template-columns: repeat(6, 1fr); }
.grid-5 > * { grid-column: span 2; }
.grid-5 > *:nth-child(4) { grid-column: 2 / span 2; }
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card p:last-child { margin-bottom: 0; }
a.card { color: inherit; display: block; }
a.card:hover, .card.hover:hover { transform: translateY(-3px); border-color: rgba(255, 107, 107, .45); box-shadow: 0 14px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(179, 18, 27, .15); }
.card h3 { margin-bottom: .45em; }
.card p { color: var(--text-2); }
.card-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(179, 18, 27, .35), rgba(179, 18, 27, .1));
  border: 1px solid rgba(255, 107, 107, .3); color: var(--accent);
}
.card-icon svg { width: 26px; height: 26px; }
.card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 700; font-size: .92rem; color: var(--accent); }
.card-link svg { width: 16px; height: 16px; transition: transform .15s; }
a.card:hover .card-link svg { transform: translateX(3px); }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 6px; background: rgba(179, 18, 27, .18); color: var(--accent-soft); border: 1px solid rgba(255, 107, 107, .25); }

/* About split */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.check-list li::before {
  content: ""; flex-shrink: 0; width: 22px; height: 22px; margin-top: 2px; border-radius: 6px;
  background: rgba(179, 18, 27, .22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b6b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat;
  border: 1px solid rgba(255, 107, 107, .35);
}
.stat-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: #fff; line-height: 1.1; margin-bottom: 4px; }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.accent { background: linear-gradient(135deg, rgba(179, 18, 27, .35), rgba(20, 20, 23, .9)); border-color: rgba(255, 107, 107, .3); }

/* Steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 22px 22px; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1; margin-bottom: 12px;
  color: transparent; -webkit-text-stroke: 1.5px var(--accent);
}
.steps h3 { font-size: 1.08rem; }
.steps p { color: var(--text-2); font-size: .95rem; margin: 0; }
.steps.vertical { grid-template-columns: 1fr; }
.steps.vertical > li { padding-left: 88px; }
.steps.vertical > li::before { position: absolute; left: 24px; top: 24px; }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 56px 48px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255, 107, 107, .25), transparent 60%),
    linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, #8f0e16);
  border: 1px solid rgba(255, 107, 107, .35);
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  box-shadow: var(--shadow-red);
}
.cta-band::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(0, 0, 0, .08) 0 2px, transparent 2px 16px); pointer-events: none; }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { margin-bottom: .3em; }
.cta-band p { margin: 0; color: #ffe1e1; max-width: 560px; }
.cta-band .btn-outline { border-color: rgba(255, 255, 255, .5); }
.cta-band .btn-outline:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-light:hover { background: #ffe3e3; color: var(--primary-dark); }

/* ---------- Page hero (sub pages) ---------- */
.page-hero {
  position: relative; overflow: hidden;
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(700px 300px at 85% 0%, rgba(179, 18, 27, .35), transparent 65%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 14px),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}
.page-hero-inner { display: flex; align-items: center; gap: 26px; }
.page-hero-icon {
  width: 84px; height: 84px; border-radius: 22px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  box-shadow: var(--shadow-red); border: 1px solid rgba(255, 107, 107, .4);
}
.page-hero-icon svg { width: 42px; height: 42px; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin-bottom: .2em; }
.page-hero p { color: var(--text-2); font-size: 1.1rem; margin: 0; max-width: 720px; }
.breadcrumb { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--border-strong); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Content layout ---------- */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.prose h2 { font-size: 1.55rem; margin-top: 1.8em; padding-bottom: .4em; border-bottom: 1px solid var(--border); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: var(--text-2); }
.prose li { margin-bottom: .4em; }
.prose ul li::marker { color: var(--accent); }
.prose ol li::marker { color: var(--accent); font-weight: 700; }
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 20px; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.side-card.highlight { border-color: rgba(255, 107, 107, .35); background: linear-gradient(180deg, rgba(179, 18, 27, .18), var(--surface) 60%); }
.side-card h3 { font-size: 1.05rem; margin-bottom: 14px; }
.side-card p { color: var(--text-2); font-size: .94rem; }
.side-card .btn + .btn { margin-top: 10px; }
.facts { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 0; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: .93rem; }
.facts li:last-child { border-bottom: 0; }
.facts span:first-child { color: var(--muted); }
.facts span:last-child { font-weight: 700; text-align: right; }
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; list-style: none; padding: 0; margin: 0 0 1em; }
.role-grid li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 16px 16px 48px; position: relative; margin: 0; color: var(--text-2); font-size: .95rem; }
.role-grid li::before { content: ""; position: absolute; left: 16px; top: 18px; width: 18px; height: 18px; border-radius: 5px; background: var(--primary); box-shadow: 0 0 0 4px rgba(179, 18, 27, .2); }
.role-grid li strong { display: block; color: var(--text); margin-bottom: 2px; }

/* Placeholder notes (hide with SHOW_PLACEHOLDER_NOTES=False in tools/build.py) */
.placeholder-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin: 0 0 22px;
  border-radius: 10px; border: 1px dashed rgba(255, 200, 87, .5);
  background: rgba(255, 200, 87, .07); color: #ffe2a3; font-size: .88rem; line-height: 1.5;
}
.placeholder-note::before { content: "✎"; font-weight: 900; }

/* Notices */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); margin-bottom: 24px; font-size: .95rem; color: var(--text-2); }
.notice[hidden] { display: none; }
.notice strong { color: var(--text); }
.notice.warn { border-color: rgba(255, 200, 87, .45); background: rgba(255, 200, 87, .07); }
.notice.error { border-color: rgba(255, 107, 107, .5); background: rgba(179, 18, 27, .14); }
.notice.success { border-color: rgba(61, 220, 132, .45); background: rgba(61, 220, 132, .08); }
.notice-icon { flex-shrink: 0; width: 22px; height: 22px; color: var(--warning); margin-top: 1px; }
.notice.error .notice-icon { color: var(--accent); }
.notice p { margin: 0 0 .5em; }
.notice p:last-child { margin: 0; }
.notice .btn-row { margin-top: 10px; }

/* ---------- Forms ---------- */
.app-form { display: grid; gap: 26px; }
.form-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin: 0; min-width: 0; }
.form-section legend { float: left; width: 100%; padding: 0; margin: 0 0 20px; font-size: 1.12rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.form-section legend + * { clear: both; }
.form-section legend .num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; clear: both; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field .label { font-weight: 700; font-size: .93rem; color: var(--text); }
.req { color: var(--accent); margin-left: 2px; }
.help { font-size: .82rem; color: var(--muted); }
.input, .field input[type="text"], .field input[type="number"], .field input[type="url"], .field select, .field textarea {
  width: 100%; font: inherit; font-size: .97rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 12px 14px; transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.field select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.field select option { background: var(--surface); color: var(--text); }
.field textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: #6c6c78; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #4a4a56; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 107, 107, .18); background: #121215; }
.field.touched input:invalid, .field.touched select:invalid, .field.touched textarea:invalid { border-color: #e0474f; }
.field-foot { display: flex; justify-content: space-between; gap: 10px; }
.counter { font-size: .78rem; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.counter.near { color: var(--warning); }
.choice-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-2);
  font-size: .93rem; font-weight: 600; color: var(--text-2); transition: border-color .15s, background .15s;
}
.choice:hover { border-color: #4a4a56; }
.choice input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; flex-shrink: 0; }
.choice:has(input:checked) { border-color: var(--accent); background: rgba(179, 18, 27, .14); color: #fff; }
.agree { align-items: flex-start; font-weight: 500; }
.agree input { margin-top: 3px; }
.hp-field { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.form-actions .help { max-width: 460px; }
.fallback-box textarea { width: 100%; min-height: 180px; margin-top: 10px; font-family: var(--mono); font-size: .85rem; background: var(--bg); color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px; }

/* Rules */
.toc { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-size: .93rem; font-weight: 600; }
.toc a:hover { background: rgba(179, 18, 27, .14); color: #fff; }
.rule-section { scroll-margin-top: calc(var(--header-h) + 20px); }
.rule-list { list-style: none; padding: 0; margin: 0 0 1.4em; counter-reset: rule; display: grid; gap: 10px; }
.rule-list li { counter-increment: rule; position: relative; padding: 14px 16px 14px 62px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 0; }
.rule-list li::before { content: attr(data-prefix) counter(rule); position: absolute; left: 14px; top: 14px; font-family: var(--mono); font-weight: 700; font-size: .82rem; color: var(--accent); background: rgba(179, 18, 27, .16); border-radius: 6px; padding: 2px 6px; }
.rule-list li strong { color: var(--text); }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 18px; }
.faq details[open] { border-color: rgba(255, 107, 107, .35); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 700; display: flex; justify-content: space-between; gap: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--text-2); padding-bottom: 6px; }

/* Thank-you / message pages */
.message-page { padding: 100px 0; }
.message-card { max-width: 640px; margin: 0 auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 48px 36px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.message-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary)); }
.message-card .logo-img { width: 180px; height: 150px; margin: 0 auto 18px; }
.message-card .big-icon { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(61, 220, 132, .12); color: var(--success); border: 1px solid rgba(61, 220, 132, .4); }
.message-card .big-icon.err { background: rgba(179, 18, 27, .16); color: var(--accent); border-color: rgba(255, 107, 107, .4); }
.message-card .big-icon svg { width: 38px; height: 38px; }
.message-card p { color: var(--text-2); }
.message-card .btn-row { justify-content: center; margin-top: 26px; }
.message-card ul { text-align: left; color: var(--text-2); display: inline-block; margin: 0 auto; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; border-top: 1px solid var(--border); background: linear-gradient(180deg, #0c0c0e, #070708); position: relative; }
.site-footer::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--primary), transparent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding: 64px 22px 44px; }
.footer-brand p { color: var(--muted); font-size: .93rem; max-width: 340px; margin: 16px 0 20px; }
.site-footer h4 { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer-links a { color: var(--text-2); font-size: .93rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0 26px; font-size: .84rem; color: var(--muted); }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 > *, .grid-5 > *:nth-child(4) { grid-column: auto; }
  .grid-5 > *:nth-child(5) { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero { padding: 64px 0 90px; }
  .hero-grid, .split, .content-grid { grid-template-columns: 1fr; gap: 36px; }
  .sidebar { position: static; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 68px 0; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .container { padding: 0 18px; }
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 34px; }
  .hero { padding: 48px 0 84px; }
  .hero .btn-row .btn { flex: 1 1 100%; }
  .connect-box { display: flex; width: 100%; }
  .connect-box code { flex: 1 1 auto; font-size: .9rem; }
  .status-card { padding: 22px; }
  .status-card .hero-logo { width: 180px; height: 150px; }
  .grid-2, .grid-3, .grid-5, .steps, .form-grid, .role-grid, .stat-panel { grid-template-columns: 1fr; }
  .grid-5 > *:nth-child(5) { grid-column: auto; }
  .form-section { padding: 20px 18px; }
  .page-hero { padding: 42px 0 38px; }
  .page-hero-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .page-hero-icon { width: 64px; height: 64px; border-radius: 16px; }
  .page-hero-icon svg { width: 32px; height: 32px; }
  .cta-band { padding: 36px 24px; border-radius: 18px; }
  .cta-band .btn-row, .cta-band .btn-row .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; padding-top: 48px; }
  .form-actions .btn { width: 100%; }
  .steps.vertical > li { padding-left: 22px; }
  .steps.vertical > li::before { position: static; }
  .message-card { padding: 36px 22px; }
  .brand-text strong { font-size: 1.08rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Professional application forms
   ========================================================================== */
.form-meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 24px; overflow: hidden;
}
.form-meta > div { padding: 16px 18px; border-right: 1px solid var(--border); min-width: 0; }
.form-meta > div:last-child { border-right: 0; }
.form-meta span { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.form-meta strong { display: block; font-size: .98rem; color: var(--text); line-height: 1.3; }

.form-progress {
  position: sticky; top: calc(var(--header-h) + 10px); z-index: 20;
  background: rgba(20, 20, 23, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.form-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; counter-reset: none; }
.form-steps a { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: .88rem; line-height: 1.2; padding: 4px; border-radius: 8px; }
.form-steps a:hover { color: var(--text); }
.step-num {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--border-strong); color: var(--muted); font-size: .85rem; font-weight: 800; background: var(--bg-2);
  transition: all .2s;
}
.form-steps a.active { color: #fff; }
.form-steps a.active .step-num { border-color: var(--accent); color: #fff; background: var(--primary); box-shadow: 0 0 0 4px rgba(179, 18, 27, .25); }
.form-steps a.done .step-num { border-color: var(--success); background: rgba(61, 220, 132, .14); color: var(--success); font-size: 0; }
.form-steps a.done .step-num::before { content: "✓"; font-size: .9rem; }
.form-steps a.has-error .step-num { border-color: #e0474f; color: #ff8a8f; }
.progress-track { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s ease; }
.progress-text { margin: 8px 0 0; font-size: .78rem; color: var(--muted); text-align: right; }

.form-section { scroll-margin-top: calc(var(--header-h) + 150px); }
.form-section legend small { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.form-section legend { align-items: center; margin-bottom: 8px; font-size: 1.25rem; }
.form-section legend .num { width: 38px; height: 38px; border-radius: 10px; font-size: 1rem; }
.section-desc { clear: both; color: var(--muted); font-size: .93rem; margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.prompt { margin: -2px 0 2px; font-size: .9rem; line-height: 1.55; color: var(--text-2); }
.opt { margin-left: 8px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-3); padding: 2px 7px; border-radius: 5px; vertical-align: 2px; }
.field-error { margin: 0; font-size: .84rem; font-weight: 600; color: #ff8a8f; display: flex; gap: 6px; align-items: flex-start; }
.field-error::before { content: "!"; flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: #e0474f; color: #fff; font-size: .7rem; font-weight: 900; display: grid; place-items: center; }
.field-error[hidden] { display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #e0474f !important; box-shadow: 0 0 0 3px rgba(224, 71, 79, .15); }
.field.valid input:not([type=checkbox]), .field.valid select, .field.valid textarea { border-color: rgba(61, 220, 132, .45); }
.counter .ok { color: var(--success); }
.counter .short { color: var(--warning); }
.ack-list { display: grid; gap: 12px; }
.ack-field .choice { padding: 16px 18px; gap: 14px; }
.ack-field .choice > span { display: block; font-weight: 500; font-size: .93rem; line-height: 1.55; color: var(--text-2); }
.ack-title { display: block; color: var(--text); font-size: .95rem; margin-bottom: 2px; }
.ack-field.invalid .choice { border-color: #e0474f; }
.ack-link { margin: 12px 0 22px; }
.signature-grid { padding-top: 20px; border-top: 1px solid var(--border); }
.signature-grid input[name="signature"]:not(:placeholder-shown) { font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive; font-size: 1.15rem; letter-spacing: .02em; }
.field input[type="date"] { width: 100%; font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 14px; color-scheme: dark; }
.form-actions { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 28px; }

@media (max-width: 900px) {
  .form-meta { grid-template-columns: repeat(2, 1fr); }
  .form-meta > div:nth-child(2) { border-right: 0; }
  .form-meta > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .form-progress { top: calc(var(--header-h) + 6px); padding: 12px 12px 10px; }
  .form-steps { gap: 4px; margin-bottom: 10px; }
  .form-steps a { flex-direction: column; gap: 4px; text-align: center; font-size: .7rem; padding: 2px; }
  .form-steps .step-label { display: none; }
  .form-steps a.active .step-label { display: block; }
  .step-num { width: 28px; height: 28px; }
  .progress-text { text-align: center; }
  .form-section legend { font-size: 1.1rem; }
  .form-actions { padding: 18px; }
  .ack-field .choice { padding: 14px; }
}
