:root {
  --ink: #171828;
  --muted: #6d6f83;
  --surface: #ffffff;
  --surface-soft: #f6f4fb;
  --surface-tint: #eee9f8;
  --line: #ded9eb;
  --brand: #7b45d6;
  --brand-dark: #5b2fb0;
  --brand-soft: #eadffd;
  --accent: #db4f8a;
  --success: #247a55;
  --warning: #9b6515;
  --danger: #b63b4a;
  --night: #101225;
  --night-2: #1b1736;
  --shadow: 0 20px 50px rgba(34, 25, 67, 0.12);
  --shadow-soft: 0 10px 28px rgba(34, 25, 67, 0.08);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --content: 1220px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f4fb 0%, #fbfafc 38%, #f3f0f8 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { touch-action: manipulation; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.15rem, 5vw, 4.7rem); line-height: 1.02; letter-spacing: -0.045em; }
h2 { font-size: clamp(1.45rem, 2.4vw, 2.2rem); line-height: 1.12; letter-spacing: -0.025em; }
h3 { line-height: 1.2; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 9999;
  background: white;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(16, 18, 37, 0.96);
  color: white;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner {
  max-width: var(--content);
  min-height: 74px;
  margin: 0 auto;
  padding: 10px 22px;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  gap: 18px;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  padding: 0;
  color: white;
  cursor: pointer;
  text-align: left;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 10px 25px rgba(123,69,214,.4);
}
.brand strong { display: block; font-size: 1.02rem; }
.brand small { display: block; color: rgba(255,255,255,.65); font-size: .72rem; }

.global-search { position: relative; }
.global-search input {
  width: 100%;
  color: #111;
  background: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 12px 48px 12px 18px;
  outline: none;
}
.global-search input:focus { box-shadow: 0 0 0 4px rgba(151,107,229,.25); }
.icon-button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-tint);
  cursor: pointer;
}
.search-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 130;
  max-height: 340px;
  overflow: auto;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 8px;
}
.search-result-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  text-align: left;
}
.search-result-button:hover, .search-result-button:focus { background: var(--surface-soft); }
.search-result-button small { color: var(--muted); }

.desktop-nav { display: flex; align-items: center; gap: 2px; }
.desktop-nav button, .site-footer button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.74);
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  font-size: .88rem;
}
.desktop-nav button:hover, .desktop-nav button.is-active { color: white; background: rgba(255,255,255,.1); }
.desktop-nav #accountNav { background: var(--brand); color: white; }
.menu-toggle { display: none; }

.page-shell { max-width: var(--content); margin: 0 auto; padding: 32px 22px 110px; }
.page { display: none; animation: pageIn .28s ease; }
.page.is-active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.site-footer {
  max-width: var(--content);
  margin: 0 auto;
  padding: 40px 22px 120px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer nav { display: flex; gap: 8px; align-items: flex-start; }
.site-footer button { color: var(--muted); }
.site-footer button:hover { color: var(--brand-dark); background: var(--brand-soft); }
.mobile-nav { display: none; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  color: #151523;
  padding: 12px 13px;
  outline: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(123,69,214,.12); }
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field-help { color: var(--muted); font-size: .86rem; }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(123,69,214,.35); outline-offset: 2px; }
[hidden] { display: none !important; }
