/* ==========================================================================
   Base Style — Reusable tokens & utility classes
   Naming: block__element (--modifier when needed)
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    --color-primary: #1e6fd9;
    --color-primary-dark: #1558b0;
    --color-secondary: #6366f1;
    --color-secondary-dark: #4f46e5;
    --color-secondary-rgb: 99, 102, 241;

    --color-text: #1a1a2e;
    --color-text-muted: #5c6370;
    --color-text-light: #ffffff;

    --color-bg: #ffffff;
    --color-bg-alt: #f4f7fb;
    --color-border: #e2e8f0;
    --color-surface: #ffffff;
    --color-surface-muted: #f8fafc;

    --color-header-bg: rgba(255, 255, 255, 0.92);
    --color-header-bg-scrolled: rgba(255, 255, 255, 0.97);

    --color-section-alt-gradient:
        radial-gradient(ellipse at 0% 0%, rgba(30, 111, 217, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);

    --color-hero-gradient:
        radial-gradient(ellipse 80% 60% at 70% 0%, rgba(30, 111, 217, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 10% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 50%, #fafcff 100%);

    --color-mockup-bg: #ffffff;
    --color-mockup-surface: #f8fafc;
    --color-input-bg: #ffffff;
    --color-input-border: #e2e8f0;

    --color-card-gradient: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
    --color-card-gradient-soft: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    --color-panel-gradient: linear-gradient(145deg, #ffffff 0%, #f8fbff 55%, #f3f6ff 100%);
    --color-panel-gradient-md: linear-gradient(145deg, #ffffff 0%, #f8fbff 50%, #f3f6ff 100%);
    --color-screen-gradient: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --color-hero-portal-end: #ffffff;
    --color-surface-inset: rgba(255, 255, 255, 0.85);
    --color-nav-btn-bg: #ffffff;
    --color-badge-dot-bg: #ffffff;
    --color-toggle-knob: #ffffff;
    --color-stat-card-bg: rgba(255, 255, 255, 0.97);
    --color-stat-card-border: rgba(255, 255, 255, 0.8);
    --color-trust-icon-bg: rgba(255, 255, 255, 0.95);
    --color-glass-bg: rgba(255, 255, 255, 0.92);
    --color-hero-stat-bg: rgba(255, 255, 255, 0.85);
    --color-float-card-bg: rgba(255, 255, 255, 0.95);
    --color-workflow-card-bg: rgba(255, 255, 255, 0.88);
    --color-workflow-track-bg: rgba(255, 255, 255, 0.7);
    --color-home-stat-bg: rgba(255, 255, 255, 0.75);
    --color-home-stat-border: rgba(255, 255, 255, 0.9);

    --color-cta-gradient: linear-gradient(135deg, #1558b0 0%, #1e6fd9 45%, #6366f1 100%);
    --color-cta-btn-bg: #ffffff;
    --color-cta-btn-color: var(--color-primary);
    --color-cta-btn-hover-color: var(--color-primary-dark);
    --color-cta-trust-icon-bg: rgba(255, 255, 255, 0.95);

    --illustration-frame-bg: #f4f7fb;
    --illustration-frame-stroke: #dbeafe;
    --illustration-panel-bg: #ffffff;
    --illustration-panel-stroke: #c7d2fe;
    --illustration-muted: #e2e8f0;
    --illustration-soft-bg: #eff6ff;
    --illustration-screen-bg: #f8fafc;
    --illustration-device-bg: #334155;

    --font-primary: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

    --header-height: 72px;
    --font-size-base: 16px;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;

    --line-height-base: 1.6;
    --line-height-tight: 1.25;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;

    --radius-sm: 0.375rem;
    --radius-md: 0.625rem;
    --radius-lg: 1rem;

    --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.08);
    --shadow-md: 0 4px 16px rgba(26, 26, 46, 0.1);
    --shadow-lg: 0 20px 50px rgba(26, 26, 46, 0.12);

    --gradient-brand: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);

    --btn-radius: 0.75rem;
    --btn-radius-pill: 999px;
    --btn-shadow: 0 4px 14px rgba(30, 111, 217, 0.32);
    --btn-shadow-hover: 0 8px 22px rgba(30, 111, 217, 0.38);
    --btn-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

    --transition-base: 0.25s ease;
}

[data-theme="dark"] {
    color-scheme: dark;

    --color-text: #e8ecf4;
    --color-text-muted: #94a3b8;
    --color-text-light: #ffffff;

    --color-bg: #0f1419;
    --color-bg-alt: #1a2230;
    --color-border: #2d3748;
    --color-surface: #1e293b;
    --color-surface-muted: #151c28;

    --color-header-bg: rgba(15, 20, 25, 0.92);
    --color-header-bg-scrolled: rgba(15, 20, 25, 0.97);

    --color-section-alt-gradient:
        radial-gradient(ellipse at 0% 0%, rgba(30, 111, 217, 0.14) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);

    --color-hero-gradient:
        radial-gradient(ellipse 80% 60% at 70% 0%, rgba(30, 111, 217, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 10% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, #131a24 0%, #0f1419 50%, #0f1419 100%);

    --color-mockup-bg: #1e293b;
    --color-mockup-surface: #151c28;
    --color-input-bg: #1a2230;
    --color-input-border: #334155;

    --color-card-gradient: linear-gradient(160deg, #1e293b 0%, #151c28 100%);
    --color-card-gradient-soft: linear-gradient(135deg, #1e293b 0%, #151c28 100%);
    --color-panel-gradient: linear-gradient(145deg, #1e293b 0%, #1a2230 55%, #151c28 100%);
    --color-panel-gradient-md: linear-gradient(145deg, #1e293b 0%, #1a2230 50%, #151c28 100%);
    --color-screen-gradient: linear-gradient(180deg, #1e293b 0%, #151c28 100%);
    --color-hero-portal-end: #1e293b;
    --color-surface-inset: rgba(255, 255, 255, 0.06);
    --color-nav-btn-bg: #1e293b;
    --color-badge-dot-bg: #1e293b;
    --color-toggle-knob: #e2e8f0;
    --color-stat-card-bg: rgba(30, 41, 59, 0.97);
    --color-stat-card-border: rgba(255, 255, 255, 0.1);
    --color-trust-icon-bg: rgba(30, 41, 59, 0.95);
    --color-glass-bg: rgba(30, 41, 59, 0.92);
    --color-hero-stat-bg: rgba(30, 41, 59, 0.88);
    --color-float-card-bg: rgba(30, 41, 59, 0.95);
    --color-workflow-card-bg: rgba(30, 41, 59, 0.95);
    --color-workflow-track-bg: rgba(0, 0, 0, 0.25);
    --color-home-stat-bg: rgba(30, 41, 59, 0.85);
    --color-home-stat-border: rgba(255, 255, 255, 0.1);

    --color-cta-gradient:
        linear-gradient(145deg, #151c28 0%, #1a2744 45%, #1e293b 100%);
    --color-cta-btn-bg: #ffffff;
    --color-cta-btn-color: var(--color-primary);
    --color-cta-btn-hover-color: var(--color-primary-dark);
    --color-cta-trust-icon-bg: rgba(255, 255, 255, 0.95);

    --illustration-frame-bg: #1a2230;
    --illustration-frame-stroke: #334155;
    --illustration-panel-bg: #151c28;
    --illustration-panel-stroke: #475569;
    --illustration-muted: #475569;
    --illustration-soft-bg: rgba(30, 111, 217, 0.14);
    --illustration-screen-bg: #1e293b;
    --illustration-device-bg: #0f1419;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] {
    color-scheme: light;
}

/* --------------------------------------------------------------------------
   Global base
   -------------------------------------------------------------------------- */
body.header__nav-open {
    overflow: hidden;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   Section — reusable layout blocks
   -------------------------------------------------------------------------- */
.section__wrapper {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.section__wrapper--alt {
    background-color: var(--color-bg-alt);
    background-image: var(--color-section-alt-gradient);
}

.section__title--accent,
.section__header--decorated .section__title {
    position: relative;
    padding-bottom: 0.875rem;
    margin-bottom: var(--spacing-xs);
}

.section__title--accent::after,
.section__header--decorated .section__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 48px;
    height: 3px;
    margin: 0;
    border-radius: 999px;
    background: var(--gradient-brand);
    transform: translateX(-50%);
}

.section__title--accent.text-lg-start::after,
.section__header--decorated.section__header--start .section__title::after,
.section__header--decorated .section__title.text-lg-start::after {
    left: 0;
    transform: none;
}

.section__label {
    display: inline-flex;
    align-items: center;
    padding: 0.3125rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    background: rgba(30, 111, 217, 0.08);
    border: 1px solid rgba(30, 111, 217, 0.12);
    border-radius: var(--btn-radius-pill);
    margin-bottom: var(--spacing-sm);
}

.section__header {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.section__title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.section__header--decorated .section__title {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
}

.section__subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------------------------------
   Text — reusable typography helpers
   -------------------------------------------------------------------------- */
.text__lead {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    line-height: var(--line-height-base);
}

.text__muted {
    color: var(--color-text-muted);
}

.text__center {
    text-align: center;
}

/* --------------------------------------------------------------------------
   Button — reusable button styles (use Bootstrap .btn for simple cases)
   -------------------------------------------------------------------------- */
.btn__primary,
.btn__outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8125rem 1.625rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition:
        transform var(--btn-transition),
        box-shadow var(--btn-transition),
        background-color var(--btn-transition),
        border-color var(--btn-transition),
        color var(--btn-transition),
        filter var(--btn-transition);
}

.btn__primary:focus-visible,
.btn__outline:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn__primary {
    color: var(--color-text-light);
    background: var(--gradient-brand);
    border: none;
    box-shadow: var(--btn-shadow);
}

.btn__primary:hover {
    color: var(--color-text-light);
    transform: translateY(-2px);
    box-shadow: var(--btn-shadow-hover);
    filter: brightness(1.04);
}

.btn__primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(30, 111, 217, 0.28);
    filter: brightness(0.98);
}

.btn__outline {
    color: var(--color-text);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.btn__outline:hover {
    color: var(--color-primary);
    background-color: rgba(30, 111, 217, 0.06);
    border-color: rgba(30, 111, 217, 0.28);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn__outline:active {
    transform: translateY(0);
    background-color: rgba(30, 111, 217, 0.1);
    box-shadow: var(--shadow-sm);
}

.btn__primary--sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    border-radius: var(--btn-radius-pill);
}

.btn__outline--sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Card — reusable content card
   -------------------------------------------------------------------------- */
.card__item {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card__item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-md);
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.card__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.card__text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   List — reset for custom styled lists
   -------------------------------------------------------------------------- */
.list__unstyled {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Dashboard — reusable decorative UI backgrounds
   -------------------------------------------------------------------------- */
.dashboard__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.dashboard__bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(30, 111, 217, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 111, 217, 0.035) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 72%);
}

.dashboard__bg-panel {
    position: absolute;
    border: 1px solid rgba(30, 111, 217, 0.1);
    background: rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(30, 111, 217, 0.06);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.dashboard__bg-line {
    display: block;
    height: 6px;
    border-radius: 3px;
    background: rgba(30, 111, 217, 0.08);
    margin-bottom: 8px;
}

.dashboard__bg-line--active {
    height: 20px;
    background: linear-gradient(135deg, rgba(30, 111, 217, 0.15), rgba(var(--color-secondary-rgb), 0.15));
}

.dashboard__bg-line:last-child {
    margin-bottom: 0;
}

.dashboard__bg-chart-bar {
    flex: 1;
    height: var(--h);
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, rgba(30, 111, 217, 0.2), rgba(var(--color-secondary-rgb), 0.12));
}

.dashboard__bg-stat {
    display: block;
    height: 10px;
    border-radius: 4px;
    background: rgba(30, 111, 217, 0.1);
    margin-bottom: 6px;
}

.dashboard__bg-stat:first-child {
    height: 16px;
    width: 60%;
}

.dashboard__bg-stat:last-child {
    margin-bottom: 0;
    width: 80%;
}

.dashboard__bg-row {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: rgba(30, 111, 217, 0.08);
    margin-bottom: 8px;
}

.dashboard__bg-row--short {
    width: 65%;
}

.dashboard__bg-row:last-child {
    margin-bottom: 0;
}

.section__has-dashboard {
    position: relative;
    overflow: hidden;
}

.section__has-dashboard > .container {
    position: relative;
    z-index: 1;
}
