:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;
    --accent: #06b6d4;
    --accent-soft: #cffafe;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;

    --bg: #f4f8fc;
    --bg-alt: #eef4fb;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: #ffffff;
    --surface-dark: #0f172a;

    --line: #dbe4ee;
    --line-strong: #cbd5e1;

    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 14px 32px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.12);

    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.5rem;

    --container-max: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 26%),
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.08), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 45%, var(--bg-alt) 100%);
    margin: 0;
}

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

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

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-top: 0;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
}

h3 {
    font-size: clamp(1.2rem, 2.2vw, 1.45rem);
}

h4, h5, h6 {
    font-size: 1.05rem;
}

small {
    color: var(--muted);
}

/* Layout helpers */
.container,
.container-fluid {
    width: min(100% - 2rem, var(--container-max));
    margin-inline: auto;
}

.content-section {
    margin: 4rem 0;
    position: relative;
}

.content-section h2 {
    position: relative;
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.content-section h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18em;
    width: 4px;
    height: 1.15em;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--primary));
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.content-section > p:first-of-type {
    color: var(--muted);
    max-width: 72ch;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(203, 213, 225, 0.7);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.navbar-brand {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--ink) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.navbar-brand::before {
    content: "";
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, var(--accent) 0 28%, transparent 30%),
        radial-gradient(circle at center, transparent 0 58%, rgba(37, 99, 235, 0.22) 60% 68%, transparent 70%),
        radial-gradient(circle at center, rgba(37, 99, 235, 0.9) 0 100%);
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.08);
    flex-shrink: 0;
}

.navbar-nav .nav-link {
    color: var(--muted);
    font-weight: 600;
    padding: 0.85rem 0.9rem;
    border-radius: 999px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--primary-dark);
    background: rgba(37, 99, 235, 0.08);
}

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 20%, rgba(96, 165, 250, 0.28), transparent 20%),
        radial-gradient(circle at 82% 28%, rgba(6, 182, 212, 0.18), transparent 22%),
        linear-gradient(135deg, #0f172a 0%, #14284f 40%, #1d4ed8 72%, #2563eb 100%);
    color: white;
    padding: clamp(4rem, 8vw, 7rem) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    width: 32rem;
    height: 32rem;
    right: -8rem;
    top: -10rem;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.13) 0 16%, transparent 18%),
        radial-gradient(circle, transparent 0 37%, rgba(255, 255, 255, 0.08) 39% 43%, transparent 45%),
        radial-gradient(circle, transparent 0 58%, rgba(255, 255, 255, 0.06) 60% 64%, transparent 66%);
    opacity: 0.8;
    pointer-events: none;
}

.hero .container,
.hero .container-fluid {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.hero p,
.hero .lead {
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    max-width: 48rem;
    margin-inline: auto;
}

.hero .btn,
.hero .button,
.hero a.btn {
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
}

.hero .btn-primary {
    background: white;
    color: var(--primary-dark);
    border: 0;
}

.hero .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.45);
}

/* Cards */
.card {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    overflow: hidden;
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.28);
}

.card-body {
    padding: 1.35rem;
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.card-text {
    color: var(--muted);
    font-size: 0.98rem;
}

.card a {
    color: inherit;
    text-decoration: none;
}

.card a:hover .card-title,
.card:hover .card-title {
    color: var(--primary-dark);
}

/* Optional subtle accent line for cards */
.card::before {
    content: "";
    display: block;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0.9;
}

/* Tables */
.settings-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
}

.table-settings,
.comparison-table,
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-settings th,
.comparison-table th,
table th {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: #334155;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    padding: 0.95rem 1rem;
    text-align: left;
}

.table-settings td,
.comparison-table td,
table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

.table-settings tr:last-child td,
.comparison-table tr:last-child td,
table tr:last-child td {
    border-bottom: 0;
}

.comparison-table td:first-child,
.table-settings td:first-child {
    font-weight: 600;
    color: var(--ink);
}

/* Calculator panels */
.calculator-section {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.calculator-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 22%),
        radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.07), transparent 24%);
    pointer-events: none;
}

.calculator-section > * {
    position: relative;
    z-index: 1;
}

.calculator-input {
    margin-bottom: 1rem;
}

.calculator-section label {
    display: inline-block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    color: var(--ink);
}

.calculator-section input,
.calculator-section select,
.calculator-section textarea,
.form-control,
.form-select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    padding: 0.8rem 0.95rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.calculator-section input:focus,
.calculator-section select:focus,
.calculator-section textarea:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    background: #fff;
}

.calculator-result {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e3a8a;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        0 10px 25px rgba(59, 130, 246, 0.08);
}

/* Buttons */
.btn,
button,
input[type="submit"],
input[type="button"] {
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn-primary,
button.btn-primary,
input[type="submit"] {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: 0;
    color: white;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover,
button.btn-primary:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

.btn-outline-primary {
    border: 1px solid rgba(37, 99, 235, 0.28);
    color: var(--primary-dark);
    background: rgba(37, 99, 235, 0.05);
}

.btn-outline-primary:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* Badges / pills */
.badge-custom,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
    background: rgba(37, 99, 235, 0.09);
    color: var(--primary-dark);
    border: 1px solid rgba(37, 99, 235, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Alerts / callouts */
.alert-info-custom,
.alert-warning-custom,
.alert {
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    margin: 1.5rem 0;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.alert-info-custom {
    background: linear-gradient(135deg, #e0f2fe 0%, #eff6ff 100%);
    border-left: 4px solid var(--primary);
    border-color: rgba(59, 130, 246, 0.22);
    color: #1e3a8a;
}

.alert-warning-custom {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

/* Lists */
ul, ol {
    padding-left: 1.2rem;
}

li + li {
    margin-top: 0.35rem;
}

/* FAQ styling */
.accordion-item,
details {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.85rem;
    overflow: hidden;
}

.accordion-button,
summary {
    font-weight: 700;
    color: var(--ink);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
    cursor: pointer;
    padding: 1rem 1.15rem;
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

/* Section surfaces */
.section-surface {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(219, 228, 238, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

/* Footer */
footer {
    margin-top: 5rem;
    border-top: 1px solid rgba(203, 213, 225, 0.65);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 20%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    color: var(--muted);
    padding: 2rem 0 3rem;
}

footer p,
footer a {
    color: var(--muted);
}

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

/* Utility */
.text-muted {
    color: var(--muted) !important;
}

.shadow-soft {
    box-shadow: var(--shadow-sm);
}

.shadow-medium {
    box-shadow: var(--shadow-md);
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

/* Responsive */
@media (max-width: 991.98px) {
    .hero {
        padding: 4.5rem 0 4rem;
    }

    .content-section {
        margin: 3rem 0;
    }

    .calculator-section {
        padding: 1.35rem;
    }

    .card-body {
        padding: 1.15rem;
    }
}

@media (max-width: 767.98px) {
    body {
        background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
            linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p,
    .hero .lead {
        font-size: 1rem;
    }

    .content-section h2 {
        padding-left: 0.85rem;
    }

    .content-section h2::before {
        width: 3px;
    }

    .calculator-result {
        font-size: 1.05rem;
        padding: 1.2rem;
    }

    .navbar-brand {
        font-size: 1.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}