/* ══════════════════════════════════════════════════════
   DejaFlow Modern Theme — shared across all pages
   ══════════════════════════════════════════════════════ */

/* ── Design tokens ────────────────────────────────── */
:root {
    --brand-primary:   #2563eb;
    --brand-secondary: #16a34a;
    --brand-accent:    #ea580c;

    --bg-base:    #ffffff;
    --bg-alt:     #f8fafc;
    --bg-muted:   #f1f5f9;
    --bg-dark:    #1e293b;
    --bg-card:    #ffffff;

    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-inverse:   #f8fafc;

    --border:         #e2e8f0;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:      0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:      0 10px 40px rgba(0,0,0,.14);

    --radius-md: 12px;
    --radius-lg: 20px;

    --hero-overlay: linear-gradient(135deg, rgba(15,23,42,.78) 0%, rgba(37,99,235,.55) 100%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-base:    #0f172a;
        --bg-alt:     #1e293b;
        --bg-muted:   #1e293b;
        --bg-card:    #1e293b;

        --text-primary:   #f1f5f9;
        --text-secondary: #94a3b8;

        --border:     #334155;
        --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
        --shadow-md:  0 4px 16px rgba(0,0,0,.4);
        --shadow-lg:  0 10px 40px rgba(0,0,0,.5);

        --hero-overlay: linear-gradient(135deg, rgba(15,23,42,.88) 0%, rgba(37,99,235,.60) 100%);
    }
}

/* ── Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    height: auto !important;
}

body {
    background-color: var(--bg-base) !important;
    color: var(--text-primary) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    height: auto !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

footer {
    margin-top: auto;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Remove bottom padding on last section so footer sits flush */
body > section:last-of-type {
    padding-bottom: 0 !important;
}

h1, h2, h3 { line-height: 1.25; font-weight: 700; color: var(--text-primary); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);   }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

p { color: var(--text-secondary); }

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── Layout helpers ───────────────────────────────── */
.df-section {
    padding: 72px 24px;
}
.df-section--alt  { background-color: var(--bg-alt); }
.df-section--muted { background-color: var(--bg-muted); }

.df-container {
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
}

/* ── Header / navbar ──────────────────────────────── */
/* Keep #navbar full-width (yellow bar spans page); center content with padding */
#navbar {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    padding: 0 max(32px, calc((100% - 1320px) / 2)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 64px !important;
}

.df-grid {
    display: grid;
    gap: 28px;
}
.df-grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.df-grid--3 { grid-template-columns: repeat(3, 1fr); }
.df-grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 900px) {
    .df-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .df-grid--3 { grid-template-columns: 1fr; }
}

/* ── Card ─────────────────────────────────────────── */
.df-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease;
}
.df-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.df-card__icon {
    font-size: 1.6rem;
    margin-bottom: 12px;
    line-height: 1;
}
.df-card h3 { margin: 0 0 12px; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-primary); }
.df-card p  { color: var(--text-secondary); font-size: .92rem; line-height: 1.6; }
.df-card ul { padding-left: 0; margin: 0; list-style: none; }
.df-card ul li {
    margin-bottom: 8px;
    padding-left: 1.2em;
    position: relative;
    font-size: .92rem;
    color: var(--text-secondary);
}
.df-card ul li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--brand-primary);
    font-weight: 700;
}
.df-card ul li a { color: var(--brand-primary); }

/* ── Hero section ─────────────────────────────────── */
.df-hero {
    background-image: var(--hero-overlay), url('/img/dejaflow-automatic-connector.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-inverse);
    padding: 100px 24px;
    min-height: 520px;
    display: flex;
    align-items: center;
}
.df-hero__inner {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: center;
    width: 100%;
}
@media (max-width: 768px) {
    .df-hero__inner { grid-template-columns: 1fr; }
}

.df-hero h1 { color: #fff; margin-top: 0; }
.df-hero h2 { color: rgba(255,255,255,.88); font-size: 1.3rem; font-weight: 400; margin-bottom: 1.5rem; }

.df-hero ol {
    padding-left: 1.4em;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}
.df-hero ol li { margin-bottom: 8px; color: var(--text-inverse); }
.df-hero a { color: #93c5fd; }
.df-hero a:hover { color: #bfdbfe; }
.df-hero p { color: var(--text-inverse); }

/* ── Page hero (smaller, for inner pages) ─────────── */
.df-page-hero {
    background-image: var(--hero-overlay), url('/img/dejaflow-automatic-connector.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-inverse);
    padding: 64px 24px;
    text-align: center;
}
.df-page-hero h1 { color: #fff; margin: 0 0 8px; }
.df-page-hero p  { color: rgba(255,255,255,.85); font-size: 1.15rem; margin: 0; max-width: 600px; margin-inline: auto; }

/* Badge strip */
.df-badge-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 24px;
}
.df-badge-strip img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    transition: transform .2s;
}
.df-badge-strip img:hover { transform: scale(1.08); }

/* CTA buttons column */
.df-hero__cta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 220px;
}
@media (max-width: 768px) {
    .df-hero__cta { flex-direction: row; flex-wrap: wrap; }
}

/* ── Buttons ──────────────────────────────────────── */
.df-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: filter .15s, transform .15s, box-shadow .15s;
    white-space: nowrap;
}
.df-btn:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }

.df-btn--primary  { background: #ffffff; color: #1e293b; }
.df-btn--blue     { background: var(--brand-primary); color: #fff; }
.df-btn--success  { background: var(--brand-secondary); color: #fff; }
.df-btn--outline  { background: rgba(255,255,255,.15); color: #fff; border: 2px solid rgba(255,255,255,.85); }
.df-btn--outline:hover { background: rgba(255,255,255,.28); border-color: #fff; }

/* ── Steps section ────────────────────────────────── */
.df-steps {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    counter-reset: step-counter;
}
.df-step {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    counter-increment: step-counter;
}
.df-step__num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.df-step h3 { margin: 0; font-size: 1rem; }
.df-step p  { margin: 0; color: var(--text-secondary); font-size: .9rem; }

/* ── Feature blocks ───────────────────────────────── */
.df-feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}
@media (max-width: 768px) {
    .df-feature { grid-template-columns: 1fr; }
    .df-feature--reverse .df-feature__img { order: -1; }
}
.df-feature__img img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
}

/* ── Pricing pills ────────────────────────────────── */
.df-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.df-price-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease, transform .2s ease;
}
.df-price-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.df-price-card--accent { border-top: 4px solid var(--brand-primary); }
.df-price-card--green  { border-top: 4px solid var(--brand-secondary); }
.df-price-card--orange { border-top: 4px solid var(--brand-accent); }
.df-price-card__badge {
    display: inline-block;
    background: var(--brand-primary);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 10px;
    border-radius: 99px;
    margin-bottom: 12px;
    width: fit-content;
}
.df-price-card__badge--green  { background: var(--brand-secondary); }
.df-price-card__badge--orange { background: var(--brand-accent); }
.df-price-card h3 { margin: 0 0 4px; color: var(--text-primary); text-transform: none; letter-spacing: normal; }
.df-price-card .price { font-size: 2rem; font-weight: 800; color: var(--brand-primary); }
.df-price-card .price span { font-size: 1rem; font-weight: 400; color: var(--text-secondary); }
.df-price-card p  { color: var(--text-secondary); font-size: .9rem; margin: 8px 0 0; }
.df-price-card ul { padding-left: 0; margin: 12px 0 0; list-style: none; }
.df-price-card ul li {
    margin-bottom: 6px;
    padding-left: 1.4em;
    position: relative;
    font-size: .88rem;
    color: var(--text-secondary);
}
.df-price-card ul li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--brand-secondary);
    font-weight: 700;
}

/* ── Account types grid ───────────────────────────── */
.df-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.df-account-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

/* ── Section label ────────────────────────────────── */
.df-section-label {
    display: inline-block;
    color: var(--brand-primary);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.df-section-title { margin: 0 0 8px; }
.df-section-sub   { color: var(--text-secondary); margin: 0 0 40px; max-width: 620px; }

/* ── Connector image ──────────────────────────────── */
.df-connector-img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 360px;
    margin: 0 auto;
}

/* ── Blog feed ────────────────────────────────────── */
#blogFeed {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
    align-items: start !important;
}

/* Override dd_header_2020.php which sets min-height: 200px on #blogFeed p */
#blogFeed p {
    min-height: 0 !important;
}
@media (max-width: 900px) {
    #blogFeed { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
    #blogFeed { grid-template-columns: 1fr !important; }
}

/* ── Utility ──────────────────────────────────────── */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.belowthefold { visibility: visible; }
