/* Ad Flare Digital — Lead Engine. Matched to portal.adflaredigital.com (light + dark). */
:root {
  --bg:           #f8f9fa;
  --bg2:          #f0f4f8;
  --card:         #ffffff;
  --navy:         #1b3a6b;
  --navy-dark:    #0d2550;
  --orange:       #e8621a;
  --orange-light: #f07832;
  --blue-light:   #5bc8f5;
  --blue-mid:     #2e7fd4;
  --blue-dark:    #1a5ca8;
  --text:         #0d1b2a;
  --text-muted:   #3d4f6b;
  --border:       rgba(13, 27, 42, 0.1);
  --accent:       var(--orange);
  --accent-grad:  linear-gradient(135deg, var(--orange), var(--orange-light));
  --on-accent:    #fff;
  --ok:           #1bbf72;
  --ease:         cubic-bezier(0.23, 1, 0.32, 1);
  --shadow:       0 4px 24px rgba(27, 58, 107, 0.08);
  --shadow-hover: 0 16px 48px rgba(27, 58, 107, 0.14);
}
/* DARK MODE — mirrors the portal: orange accents flip to blue */
body.dark-mode {
  --bg:        #080b12;
  --bg2:       #0d1424;
  --card:      #101726;
  --text:      #edf0f7;
  --text-muted:#8a9ab8;
  --border:    rgba(255, 255, 255, 0.08);
  --accent:      var(--blue-light);
  --accent-grad: linear-gradient(135deg, var(--blue-light), #3ab8e8);
  --on-accent:   #0d1b2a;
  --shadow:       0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Manrope', sans-serif; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; transition: background .4s ease, color .4s ease;
}
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; }

/* ─── Nav (portal-style) ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; padding: 12px 32px;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); box-shadow: 0 2px 20px rgba(13, 27, 42, 0.06);
  transition: background .4s, border-color .4s;
}
body.dark-mode .nav { background: rgba(8, 11, 18, 0.96); box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3); }
.nav-logo { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.nav-logo img { height: 38px; width: auto; border-radius: 6px; }
.nav-wordmark { font-family: 'Space Grotesk', sans-serif; font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); }
body.dark-mode .nav-wordmark { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.greeting { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.greeting span { color: var(--text); }

.dark-toggle {
  background: none; border: 1.5px solid var(--border); border-radius: 8px; padding: 7px 11px;
  cursor: pointer; font-size: 16px; line-height: 1; transition: background .18s, border-color .18s;
}
.dark-toggle:hover { background: rgba(27, 58, 107, 0.06); border-color: var(--navy); }
body.dark-mode .dark-toggle { border-color: rgba(168, 191, 232, 0.3); color: #a8bfe8; }
body.dark-mode .dark-toggle:hover { background: rgba(168, 191, 232, 0.08); border-color: #a8bfe8; }

.btn-outline {
  font-size: 13px; font-weight: 700; font-family: inherit; color: var(--orange);
  background: rgba(232, 98, 26, 0.06); border: 1.5px solid rgba(232, 98, 26, 0.35);
  border-radius: 8px; padding: 8px 16px; cursor: pointer; transition: background .18s, border-color .18s;
}
.btn-outline:hover { background: rgba(232, 98, 26, 0.12); border-color: var(--orange); }
body.dark-mode .btn-outline { color: var(--blue-light); background: rgba(91, 200, 245, 0.08); border-color: rgba(91, 200, 245, 0.35); }

/* ─── Credits pill ─── */
.credits { display: flex; align-items: center; gap: 9px; background: var(--bg2); border: 1px solid var(--border); padding: 7px 13px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.credits-plan { background: var(--accent); color: var(--on-accent); padding: 2px 9px; border-radius: 100px; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }
.credits-bar { width: 80px; height: 6px; background: var(--border); border-radius: 100px; overflow: hidden; }
.credits-fill { display: block; height: 100%; width: 0%; background: var(--accent); border-radius: 100px; transition: width .4s var(--ease); }

.overage-note { margin-top: 68px; background: #fff7ed; border-bottom: 1px solid #ffe2c4; color: #9a4a08; font-size: 13px; font-weight: 600; text-align: center; padding: 9px 20px; }
body.dark-mode .overage-note { background: #1a1206; border-bottom-color: #3a2a10; color: #f0b577; }

/* ─── Layout ─── */
main { max-width: 1240px; margin: 0 auto; padding: 100px 32px 48px; }
.page-head { margin-bottom: 24px; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.page-head h1 { font-size: 28px; letter-spacing: -.02em; margin-bottom: 6px; }
.page-head .sub { font-size: 15px; color: var(--text-muted); }
.grid { display: grid; grid-template-columns: 372px 1fr; gap: 24px; align-items: start; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; transition: background .4s, border-color .4s; }
.panel h2 { font-size: 17px; margin-bottom: 18px; }

/* ─── Form ─── */
label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
label small { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); margin-top: 6px; }
input[type=text], input[type=number], input[type=email], input[type=password] {
  width: 100%; margin-top: 7px; padding: 12px 14px; font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px;
  outline: none; transition: border-color .2s, background .3s;
}
input::placeholder { color: var(--text-muted); opacity: .5; }
input:focus { border-color: var(--accent); }
.row { display: flex; gap: 16px; align-items: flex-end; }
.grow { flex: 1; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 600; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.checkbox input { width: auto; margin: 0; accent-color: var(--accent); }
.estimate { font-size: 13px; color: var(--text-muted); min-height: 18px; margin: 2px 0 16px; }
.estimate b { color: var(--accent); font-weight: 700; }

/* ─── Buttons ─── */
.btn { border: 0; border-radius: 10px; padding: 13px 20px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; transition: transform .12s var(--ease), box-shadow .2s, opacity .15s; }
.btn.primary { width: 100%; color: var(--on-accent); background: var(--accent-grad); box-shadow: 0 6px 20px rgba(232, 98, 26, 0.28); }
body.dark-mode .btn.primary { box-shadow: 0 6px 20px rgba(91, 200, 245, 0.22); }
.btn.primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: none; color: var(--text); border: 1.5px solid var(--border); }
.btn.ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn.ghost:disabled { opacity: .45; cursor: not-allowed; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 16px; line-height: 1.5; }

/* ─── Results ─── */
.results-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.actions { display: flex; align-items: center; gap: 16px; }
.summary { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.status { display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-size: 14px; font-weight: 500; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 48px 16px; text-align: center; color: var(--text-muted); border: 1.5px dashed var(--border); border-radius: 12px; }
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--bg2); }
td a { color: var(--accent); text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }
.muted-sub { color: var(--text-muted); }
.hidden { display: none !important; }

/* ─── Billing bar + plan modal ─── */
.billing-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 20px; margin-bottom: 20px; flex-wrap: wrap; }
.bb-left { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.bb-sub { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.bb-actions { display: flex; gap: 10px; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 100px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; background: var(--accent); color: var(--on-accent); }
.pill.muted { background: var(--bg2); color: var(--text-muted); }

.modal-bg { position: fixed; inset: 0; background: rgba(8, 11, 18, .55); display: none; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.modal-bg.show { display: flex; }
.modal { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal h3 { font-family: 'Space Grotesk', sans-serif; font-size: 19px; margin-bottom: 18px; }
.modal .err { background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .25); color: #dc2626; border-radius: 9px; padding: 10px 13px; font-size: 13px; margin-bottom: 14px; display: none; }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-option { display: flex; justify-content: space-between; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px; transition: border-color .15s; }
.plan-option:hover { border-color: var(--accent); }
.plan-option.current { border-color: var(--accent); background: var(--bg2); }
.po-name { font-weight: 700; font-family: 'Space Grotesk', sans-serif; font-size: 15px; }
.po-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.po-price { font-weight: 700; font-size: 16px; }
.po-price small { font-weight: 500; color: var(--text-muted); }

@media (max-width: 1040px) { .credits-bar { display: none; } }
@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr; } main { padding: 92px 20px 40px; }
  .nav { padding: 12px 18px; } .greeting { display: none; }
}
