:root {
  --bg: #0f1117;
  --bg2: #161820;
  --bg3: #1e2028;
  --card: #1a1d27;
  --border: #2a2d3a;
  --accent: #7cfc00;
  --accent2: #5cd600;
  --accent-dim: rgba(124, 252, 0, 0.12);
  --text: #e8eaf0;
  --text2: #9da3b4;
  --text3: #6b7280;
  --white: #ffffff;
  --red: #ff4757;
  --yellow: #ffd700;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 55% at 70% 0%, rgba(124, 252, 0, 0.08), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, #0b0d13 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(42, 45, 58, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 45, 58, 0.55) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.35;
}

.aip-calculator {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.back-link {
  display: inline-flex;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 12px;
}

h1 {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--white);
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

h2 { margin: 0 0 12px; color: var(--white); }
.aip-head p:last-child { color: var(--text2); max-width: 660px; font-size: 1.05rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
  gap: 20px;
  align-items: start;
  margin-top: 34px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: rgba(26, 29, 39, 0.94);
  box-shadow: var(--shadow);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.tab {
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  transition: .2s ease;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  box-shadow: 0 8px 32px rgba(124, 252, 0, 0.22);
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  min-height: 50px;
  margin-top: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  background: var(--bg3);
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

select option { background: var(--bg3); color: var(--text); }
textarea { resize: vertical; }

.note { color: var(--text3); font-size: 13px; }
.error { color: var(--red); font-weight: 900; }
.warning {
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(255, 215, 0, 0.08);
  color: #ffe98a;
}

.primary {
  min-height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 24px;
  background: var(--accent);
  color: var(--bg);
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
  transition: .2s ease;
}

.primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(124, 252, 0, 0.25);
}

.result { position: sticky; top: 16px; }
.total {
  padding: 18px;
  border: 1px solid rgba(124, 252, 0, 0.28);
  border-radius: var(--radius);
  background: var(--accent-dim);
  margin-bottom: 14px;
}
.total span { display: block; color: var(--accent); font-size: 13px; font-weight: 900; text-transform: uppercase; }
.total b { display: block; margin-top: 4px; color: var(--white); font-size: 30px; line-height: 1.15; }

dl { display: grid; gap: 10px; margin: 0; }
dl div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
dt { color: var(--text2); }
dd { margin: 0; color: var(--text); text-align: right; font-weight: 900; }
small { display: block; color: var(--text3); font-weight: 500; font-size: 12px; }

.lead { margin-top: 20px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.cta a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  background: var(--bg3);
  text-decoration: none;
  font-weight: 850;
}
.cta a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.wide { grid-column: 1 / -1; }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .aip-calculator { width: min(100% - 32px, 640px); padding: 24px 0 44px; }
  .layout, .fields { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: 1fr; }
  .primary { width: 100%; }
  .result { position: static; }
  .panel { padding: 18px; }
}
