/* ForexExpert.com — premium fintech SaaS */
:root {
    --bg: #0f172a;
    --bg-elevated: #111c33;
    --glass: rgba(30, 41, 59, 0.55);
    --glass-border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #22c55e;
    --accent-soft: rgba(34, 197, 94, 0.14);
    --accent-hover: #16a34a;
    --border: rgba(51, 65, 85, 0.85);
    --error: #f87171;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.35);
    --radius: 14px;
    --radius-lg: 20px;
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: #4ade80;
}

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-wide {
    max-width: 1200px;
}

/* Top nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(15, 23, 42, 0.72);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.logo {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.95rem;
}

.nav-links a {
    color: var(--muted);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text);
}

/* Calculators dropdown (header) */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > summary {
    list-style: none;
    cursor: pointer;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.35rem 0;
}

.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown[open] > summary {
    color: var(--text);
}

.nav-dropdown-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 240px;
    padding: 0.45rem;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    z-index: 120;
    backdrop-filter: blur(12px);
}

.nav-dropdown-panel a {
    display: block;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-dropdown-panel a:hover {
    background: var(--accent-soft);
    color: var(--text);
}

@media (max-width: 900px) {
    .nav-dropdown-panel {
        position: static;
        margin-top: 0.35rem;
        margin-bottom: 0.25rem;
        box-shadow: none;
        border: 1px solid var(--border);
        min-width: 100%;
    }
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #16a34a);
    color: #052e16 !important;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.35);
}

main {
    flex: 1;
}

/* Hero */
.hero-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem);
    margin: 2rem 0 3rem;
    background:
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(34, 197, 94, 0.22), transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 20%, rgba(56, 189, 248, 0.12), transparent 50%),
        linear-gradient(165deg, #111c33 0%, #0f172a 45%, #0b1222 100%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.hero-grid {
    display: grid;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(1.85rem, 4.2vw, 2.75rem);
    line-height: 1.12;
    margin: 0 0 1rem;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.hero-sub {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0 0 1.75rem;
    max-width: 34rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.35rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), #16a34a);
    color: #052e16;
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 14px 36px rgba(34, 197, 94, 0.38);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-ghost:hover {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.06);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}

/* Glass cards */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem 1.6rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: rgba(34, 197, 94, 0.22);
}

.section {
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

.section-desc {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Calculator layout */
.calc-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 880px) {
    .calc-grid {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

.input-stack label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.input-stack input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-stack input:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.calc-results {
    display: grid;
    gap: 0.85rem;
}

.result-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.4));
    border: 1px solid rgba(34, 197, 94, 0.22);
    transition: transform 0.25s ease;
}

.result-tile.is-pulse {
    animation: pulseGlow 0.55s ease;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35);
    }
    100% {
        box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
    }
}

.result-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.result-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

/* Benefits grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.1rem;
}

.benefit-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid rgba(34, 197, 94, 0.28);
    margin-bottom: 0.85rem;
    color: var(--accent);
}

.benefit-title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.benefit-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

/* Blog cards */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.blog-card-link {
    display: block;
    height: 100%;
    color: inherit;
}

.blog-card-link:hover .blog-card-title {
    color: var(--accent);
}

.blog-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
}

.blog-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.65rem;
}

.blog-excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

/* CTA band */
.cta-band {
    border-radius: var(--radius-lg);
    padding: clamp(2rem, 4vw, 3rem);
    background:
        radial-gradient(ellipse 60% 80% at 0% 50%, rgba(34, 197, 94, 0.18), transparent 60%),
        linear-gradient(135deg, #111c33, #0f172a);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.cta-band h2 {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cta-band p {
    margin: 0;
    color: var(--muted);
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.85));
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3 {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.footer-col p,
.footer-col a {
    font-size: 0.9rem;
    color: var(--muted);
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--muted);
}

/* Forms */
.field-error {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

/* Toast */
.toast-root {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 260px;
    max-width: min(420px, calc(100vw - 2rem));
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    animation: toastIn 0.4s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reveal on scroll */
[data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Blog article */
.article-shell {
    display: grid;
    gap: 2rem;
}

@media (min-width: 960px) {
    .article-shell {
        grid-template-columns: minmax(0, 1fr) 300px;
        align-items: start;
    }
}

.prose {
    font-size: 1.05rem;
    color: #e2e8f0;
}

.prose p {
    margin: 0 0 1.1rem;
}

.sidebar-card {
    position: sticky;
    top: 5.5rem;
}

.sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-list li {
    border-bottom: 1px solid var(--border);
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list a {
    display: block;
    padding: 0.75rem 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.sidebar-list a:hover {
    color: var(--text);
}

nav .pagination,
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

nav .pagination li a,
nav .pagination li span,
.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--muted);
}

nav .pagination li.active span,
.pagination li.active span {
    border-color: rgba(34, 197, 94, 0.45);
    color: var(--accent);
    font-weight: 700;
}

nav .pagination li.disabled span,
.pagination li.disabled span {
    opacity: 0.35;
}

/* Admin (shared) */
.admin-body {
    background: #0b1120;
}

.admin-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 260px 1fr;
}

@media (max-width: 900px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .admin-nav form {
        margin-top: 0 !important;
        width: 100%;
    }
}

.admin-sidebar {
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
}

.admin-brand {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-nav a:hover,
.admin-nav a.is-active {
    background: var(--accent-soft);
    color: var(--text);
}

.admin-main {
    padding: 1.75rem 1.5rem 3rem;
}

.admin-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0 0 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.5);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.admin-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.admin-form input,
.admin-form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text);
    font-size: 0.95rem;
}

.admin-form textarea {
    min-height: 220px;
    resize: vertical;
}

.admin-form .form-row {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: var(--accent-soft);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.login-card {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.login-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* Standalone calculator tools (Pip / Profit) */
.calc-split {
    display: grid;
    gap: 1.25rem;
    align-items: start;
    width: 100%;
    max-width: 1040px;
}

@media (min-width: 900px) {
    .calc-split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .calc-split .calc-result-panel {
        margin-top: 0;
        position: sticky;
        top: 5.75rem;
        align-self: start;
    }
}

.calc-split .glass-card {
    max-width: none;
    width: 100%;
}

.calc-tool-hero {
    margin-bottom: 2rem;
}

.calc-tool-hero .hero-badge {
    margin-bottom: 0.75rem;
}

.calc-submit-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.calc-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(34, 197, 94, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: calc-spin 0.65s linear infinite;
    flex-shrink: 0;
}

@keyframes calc-spin {
    to {
        transform: rotate(360deg);
    }
}

.calc-spinner[hidden] {
    display: none !important;
}

.calc-result-panel {
    margin-top: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}

.calc-result-panel.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.calc-alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(248, 113, 113, 0.38);
    background: rgba(248, 113, 113, 0.08);
    color: #fecaca;
    font-size: 0.9rem;
    margin-top: 1rem;
    line-height: 1.45;
}

.calc-alert[hidden] {
    display: none !important;
}

.btn.is-loading {
    opacity: 0.75;
    pointer-events: none;
}
