/* Custom styles for DjangoBase */

/* General */
html {
    overflow-x: hidden; /* Bootstrap .row's negative gutter margins (-12px by
        default) push slightly past the viewport on narrow screens — this is
        normal Bootstrap behavior, not a layout bug, but without a clip it
        causes a few px of real horizontal scroll on mobile. */
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-wrap: anywhere; /* a long unbroken string (URL, query string,
        email) in body copy has no natural wrap point and otherwise forces
        the page wider than the viewport — found on the UTM builder tool
        page's worked-example paragraph (uri query strings), 314px of
        horizontal overflow on a 390px mobile viewport. */
}

main {
    flex: 1;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
}

/* Dropdown menu scrollable */
.dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
}

/* Forms */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Alerts */
.alert ul {
    margin: 0;
    padding-left: 1rem;
}

/* Pricing */
.pricing-card {
    border-radius: 0.5rem;
    transition: transform 0.2s;
}

.pricing-card:hover {
    transform: translateY(-5px);
}

.pricing-card.featured {
    border: 2px solid var(--bs-primary);
}

/* Payment form */
#card-element {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
}

/* =========================================================================
   AlwaysOn landing — "power-light" brand system.
   Everything prefixed .ao- (never .col-* — Bootstrap collision, fleet gotcha).
   Scope: body.ao-dark (landing pages only; app pages stay default theme).
   ========================================================================= */

body.ao-dark {
    --ao-bg: #0b1420;
    --ao-bg-2: #0f1b2a;
    --ao-panel: #122033;
    --ao-line: #22354c;
    --ao-ink: #e9eff6;
    --ao-muted: #93a5b8;
    --ao-amber: #ffb703;
    --ao-amber-soft: rgba(255, 183, 3, .12);
    --ao-green: #2ec27e;
    background:
        radial-gradient(1100px 520px at 78% -140px, rgba(255,183,3,.07), transparent 60%),
        radial-gradient(900px 480px at -10% 30%, rgba(46,120,210,.08), transparent 55%),
        var(--ao-bg);
    color: var(--ao-ink);
}
/* .ao-flush = page builds its own top/bottom spacing (hero, container py-*)
   and would get doubled padding from main's default py-4. */
body.ao-dark.ao-flush main { padding: 0 !important; }
body.ao-dark .navbar,
body.ao-dark footer {
    background: rgba(11, 20, 32, .85) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--ao-line);
}
body.ao-dark footer { border-top: 1px solid var(--ao-line); border-bottom: 0; }
body.ao-dark .navbar .nav-link, body.ao-dark .navbar-brand,
body.ao-dark footer a, body.ao-dark footer p { color: var(--ao-ink); }
body.ao-dark .navbar .nav-link:hover { color: var(--ao-amber); }
body.ao-dark footer .text-muted { color: var(--ao-muted) !important; }

/* Site-wide component theming: plain content pages (about, contact, login,
   signup, tools, privacy, terms...) only had the dark body background —
   generic Bootstrap components on them stayed unstyled dark-mode gray/blue
   instead of the navy-panel + amber brand look used on index/pricing. */
body.ao-dark a:not(.btn) { color: var(--ao-amber); }
body.ao-dark a:not(.btn):hover { color: #ffc42e; }
body.ao-dark .card {
    background: var(--ao-panel);
    border-color: var(--ao-line);
    color: var(--ao-ink);
}
body.ao-dark .card .text-muted { color: var(--ao-muted) !important; }
body.ao-dark .btn-primary {
    background: var(--ao-amber); border-color: var(--ao-amber); color: #141002;
}
body.ao-dark .btn-primary:hover,
body.ao-dark .btn-primary:focus {
    background: #ffc42e; border-color: #ffc42e; color: #141002;
}
body.ao-dark .btn-outline-primary {
    color: var(--ao-amber); border-color: var(--ao-amber);
}
body.ao-dark .btn-outline-primary:hover {
    background: var(--ao-amber); border-color: var(--ao-amber); color: #141002;
}
body.ao-dark .form-control, body.ao-dark .form-select {
    background: var(--ao-bg-2); border-color: var(--ao-line); color: var(--ao-ink);
}
body.ao-dark .form-control:focus, body.ao-dark .form-select:focus {
    background: var(--ao-bg-2); border-color: var(--ao-amber); color: var(--ao-ink);
    box-shadow: 0 0 0 .2rem rgba(255,183,3,.2);
}
body.ao-dark .form-control::placeholder { color: var(--ao-muted); }
body.ao-dark .form-label { color: var(--ao-ink); }
body.ao-dark .alert-danger {
    background: rgba(224,60,60,.12); border-color: rgba(224,60,60,.4); color: #ff9a92;
}
body.ao-dark .alert-success {
    background: rgba(46,194,126,.12); border-color: rgba(46,194,126,.4); color: var(--ao-green);
}
body.ao-dark hr { border-color: var(--ao-line); opacity: 1; }
body.ao-dark .dropdown-menu { background: var(--ao-panel); border-color: var(--ao-line); }
body.ao-dark .dropdown-item { color: var(--ao-ink); }
body.ao-dark .dropdown-item:hover, body.ao-dark .dropdown-item:focus {
    background: var(--ao-bg-2); color: var(--ao-amber);
}

/* Buttons */
.ao-btn-amber {
    background: var(--ao-amber); border: 0; color: #141002; font-weight: 700;
    padding: .8rem 1.6rem; border-radius: .6rem;
    box-shadow: 0 6px 24px rgba(255,183,3,.28);
    transition: transform .12s ease, box-shadow .12s ease;
}
.ao-btn-amber:hover { background: #ffc42e; color: #141002; transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(255,183,3,.36); }
.ao-btn-ghost {
    background: transparent; border: 1px solid var(--ao-line); color: var(--ao-ink);
    padding: .8rem 1.6rem; border-radius: .6rem; font-weight: 600;
}
.ao-btn-ghost:hover { border-color: var(--ao-amber); color: var(--ao-amber); }

/* Status chip + the pulsing on-dot */
.ao-chip {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--ao-amber-soft); border: 1px solid rgba(255,183,3,.35);
    color: var(--ao-amber); font-weight: 600; font-size: .85rem;
    letter-spacing: .06em; text-transform: uppercase;
    padding: .35rem .9rem; border-radius: 999px;
}
.ao-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--ao-amber); }
.ao-dot-pulse { animation: aoPulse 2s ease-out infinite; }
@keyframes aoPulse {
    0% { box-shadow: 0 0 0 0 rgba(255,183,3,.55); }
    70% { box-shadow: 0 0 0 .65rem rgba(255,183,3,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,183,3,0); }
}

/* Hero */
.ao-hero { padding: 5.5rem 0 4rem; }
.ao-hero h1 {
    font-size: clamp(2.4rem, 5.2vw, 3.9rem); font-weight: 800;
    letter-spacing: -.02em; line-height: 1.06; margin: 1.1rem 0;
}
.ao-hero h1 .ao-accent { color: var(--ao-amber); }
.ao-hero .ao-sub { color: var(--ao-muted); font-size: 1.18rem; max-width: 34rem; }
.ao-hero-note { color: var(--ao-muted); font-size: .85rem; }

/* Product mock — window chrome */
.ao-mock {
    background: var(--ao-panel); border: 1px solid var(--ao-line);
    border-radius: 1rem; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.ao-mock-bar {
    display: flex; align-items: center; gap: .45rem;
    background: var(--ao-bg-2); padding: .6rem .9rem;
    border-bottom: 1px solid var(--ao-line);
    color: var(--ao-muted); font-size: .78rem;
}
.ao-mock-bar i { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.ao-mock-body { padding: 1rem; display: grid; grid-template-columns: 1.25fr 1fr; gap: 1rem; }
@media (max-width: 575.98px) { .ao-mock-body { grid-template-columns: 1fr; } }
.ao-mock h6 {
    color: var(--ao-muted); font-size: .72rem; text-transform: uppercase;
    letter-spacing: .09em; margin-bottom: .6rem;
}
.ao-post {
    background: var(--ao-bg-2); border: 1px solid var(--ao-line);
    border-radius: .6rem; padding: .65rem .75rem; margin-bottom: .6rem;
    font-size: .84rem;
}
.ao-post-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .35rem; font-size: .72rem; color: var(--ao-muted);
}
.ao-tag {
    display: inline-block; padding: .1rem .5rem; border-radius: 999px;
    font-size: .68rem; font-weight: 700; letter-spacing: .03em;
}
.ao-tag-ig { background: rgba(214,60,140,.18); color: #ff7ac2; }
.ao-tag-fb { background: rgba(45,110,220,.2); color: #7fb2ff; }
.ao-tag-li { background: rgba(28,116,190,.2); color: #6cc0ff; }
.ao-tag-ok { background: rgba(46,194,126,.16); color: var(--ao-green); }
.ao-approve {
    border: 1px solid rgba(46,194,126,.5); color: var(--ao-green); background: transparent;
    font-size: .72rem; font-weight: 700; border-radius: .4rem; padding: .12rem .55rem;
}
/* Activity log */
.ao-log { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; }
.ao-log li {
    list-style: none; display: flex; gap: .6rem; padding: .42rem 0;
    border-bottom: 1px dashed rgba(34,53,76,.7); color: var(--ao-ink);
    opacity: 0; animation: aoRise .5s ease forwards;
}
.ao-log li:nth-child(1) { animation-delay: .15s; }
.ao-log li:nth-child(2) { animation-delay: .5s; }
.ao-log li:nth-child(3) { animation-delay: .85s; }
.ao-log li:nth-child(4) { animation-delay: 1.2s; }
.ao-log li:nth-child(5) { animation-delay: 1.55s; }
.ao-log time { color: var(--ao-muted); flex: 0 0 auto; }
.ao-log .ao-ok { color: var(--ao-green); }
.ao-log .ao-money { color: var(--ao-amber); }
@keyframes aoRise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* Platform strip */
.ao-strip { padding: 1.6rem 0 0; }
.ao-strip-title {
    text-align: center; color: var(--ao-muted); font-size: .8rem;
    text-transform: uppercase; letter-spacing: .12em; margin-bottom: 1rem;
}
.ao-platforms { display: flex; flex-wrap: wrap; gap: .6rem 1rem; justify-content: center; }
.ao-platform {
    display: inline-flex; align-items: center; gap: .5rem;
    border: 1px solid var(--ao-line); border-radius: 999px;
    padding: .4rem 1rem; color: var(--ao-ink); font-weight: 600; font-size: .9rem;
    background: rgba(18,32,51,.6);
}
.ao-platform i { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }

/* Sections */
.ao-section { padding: 4.5rem 0; }
.ao-section-alt { background: rgba(15,27,42,.55); border-top: 1px solid var(--ao-line); border-bottom: 1px solid var(--ao-line); }
.ao-kicker {
    color: var(--ao-amber); font-weight: 700; font-size: .8rem;
    text-transform: uppercase; letter-spacing: .12em;
}
.ao-section h2 { font-weight: 800; letter-spacing: -.01em; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.ao-section .ao-lead { color: var(--ao-muted); font-size: 1.05rem; }
.ao-feature-visual {
    background: var(--ao-panel); border: 1px solid var(--ao-line);
    border-radius: .9rem; padding: 1.1rem; box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.ao-ctx-chip {
    display: inline-block; background: var(--ao-bg-2); border: 1px solid var(--ao-line);
    color: var(--ao-ink); border-radius: 999px; padding: .3rem .8rem;
    font-size: .8rem; margin: 0 .35rem .5rem 0;
}
.ao-ctx-chip b { color: var(--ao-amber); font-weight: 700; }
/* budget bars */
.ao-bar-row { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; font-size: .82rem; }
.ao-bar-row span:first-child { flex: 0 0 7.5rem; color: var(--ao-muted); }
.ao-bar { flex: 1; height: .55rem; border-radius: 999px; background: var(--ao-bg-2); overflow: hidden; }
.ao-bar i { display: block; height: 100%; border-radius: 999px; }
.ao-bar-up i { width: 72%; background: linear-gradient(90deg, #2ec27e, #7be0b4); }
.ao-bar-mid i { width: 38%; background: linear-gradient(90deg, #f4b400, #ffd76b); }
.ao-bar-down i { width: 12%; background: linear-gradient(90deg, #b3423a, #e0776f); }
.ao-delta-up { color: var(--ao-green); font-weight: 700; }
.ao-delta-down { color: #e0776f; font-weight: 700; }
/* trust ladder */
.ao-ladder { display: flex; flex-direction: column; gap: .6rem; }
.ao-rung {
    display: flex; align-items: center; gap: .8rem;
    background: var(--ao-bg-2); border: 1px solid var(--ao-line);
    border-radius: .6rem; padding: .7rem .9rem; font-size: .88rem;
}
.ao-rung .ao-state { margin-left: auto; font-size: .72rem; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase; }
.ao-rung-on { border-color: rgba(255,183,3,.45); }
.ao-rung-on .ao-state { color: var(--ao-amber); }
.ao-rung-done .ao-state { color: var(--ao-green); }

/* Compare band */
.ao-compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 767.98px) { .ao-compare { grid-template-columns: 1fr; } }
.ao-compare-card {
    background: var(--ao-panel); border: 1px solid var(--ao-line);
    border-radius: .9rem; padding: 1.5rem;
    display: flex; flex-direction: column;
}
.ao-compare-card.ao-win { border-color: rgba(255,183,3,.55); position: relative; }
.ao-compare-card .ao-price { font-size: 1.7rem; font-weight: 800; margin: .4rem 0; }
.ao-compare-card ul {
    margin: 0; padding-left: 1.1rem; color: var(--ao-muted); font-size: .9rem;
    flex: 1 0 auto; /* pads out shorter feature lists so CTAs land on the same
                        baseline across cards instead of following whichever
                        card's list happens to be tallest */
}
.ao-compare-card ul li { margin-bottom: .35rem; }
.ao-win .ao-price { color: var(--ao-amber); }

/* FAQ */
body.ao-dark .accordion { --bs-accordion-bg: var(--ao-panel); --bs-accordion-border-color: var(--ao-line);
    --bs-accordion-color: var(--ao-ink); --bs-accordion-btn-color: var(--ao-ink);
    --bs-accordion-active-bg: var(--ao-bg-2); --bs-accordion-active-color: var(--ao-amber);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 .2rem rgba(255,183,3,.2); }
body.ao-dark .accordion-button::after { filter: invert(1) brightness(1.6); }
body.ao-dark .accordion-body { color: var(--ao-muted); }

/* CTA band */
.ao-cta {
    background: linear-gradient(180deg, rgba(255,183,3,.10), rgba(255,183,3,.03));
    border-top: 1px solid rgba(255,183,3,.3);
    text-align: center; padding: 4.5rem 0;
}

@media (prefers-reduced-motion: reduce) {
    .ao-dot-pulse, .ao-log li { animation: none; opacity: 1; }
}

/* Platform tag colors (full platform keys) */
.ao-tag-facebook { background: rgba(45,110,220,.2); color: #7fb2ff; }
.ao-tag-instagram { background: rgba(214,60,140,.18); color: #ff7ac2; }
.ao-tag-linkedin { background: rgba(28,116,190,.2); color: #6cc0ff; }
.ao-tag-x { background: rgba(160,160,160,.18); color: #cfcfcf; }
.ao-tag-tiktok { background: rgba(0,182,201,.16); color: #6fe3f0; }
.ao-tag-pinterest { background: rgba(189,8,28,.2); color: #ff8a95; }
.ao-tag-gbp { background: rgba(255,183,3,.14); color: var(--ao-amber); }

/* Light-page (tools) helpers */
.ao-tool-cta { border: 1px solid rgba(255,183,3,.5); border-radius: .9rem;
    background: linear-gradient(180deg, rgba(255,183,3,.08), transparent);
    padding: 1.25rem 1.5rem; }
.ao-counter-bar { height: .45rem; border-radius: 999px; background: #e9ecef; overflow: hidden; }
.ao-counter-bar i { display: block; height: 100%; background: #2ec27e; border-radius: 999px; }
.ao-counter-bar.over i { background: #dc3545; }
a.ao-platform:hover { border-color: var(--ao-amber); color: var(--ao-amber); }

/* ---------------------------------------------------------------------------
   Bootstrap gutter/padding mismatch — 12px of horizontal scroll at 390px.

   `.g-5` sets `--bs-gutter-x: 3rem` on the *row*, which gives the row -24px
   left/right margins. Its `.container` parent, however, still pads only 12px:
   `.container` declares its own `--bs-gutter-x: 1.5rem` and pads half of it,
   and a `.g-*` class on a child row never reaches it. Below `sm` the
   container is 100% wide with no max-width slack to absorb the difference, so
   24 - 12 = 12px of the row hangs past the viewport on each side and the
   right-hand one becomes horizontal page scroll.

   Where the columns are stacked full width the *horizontal* half of the
   gutter separates nothing — only `--bs-gutter-y` is doing any work. So bring
   `--bs-gutter-x` back down to the value the container's padding can actually
   absorb and leave `--bs-gutter-y` at 3rem. Rendering is pixel-identical
   (content still lands 12px from the edge); the box simply stops sticking out
   of its parent. Deliberately not `overflow-x: hidden`, which would leave the
   row mis-sized and just clip the evidence.
   --------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  .row.g-5,
  .row.gx-5 { --bs-gutter-x: 1.5rem; }
}
