/* ==========================================================================
   Investment Platform — Design System
   Flat, modern aesthetic inspired by Stripe / Linear / Vercel / Flowbite Pro.
   ========================================================================== */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-optical-sizing: auto;
    font-feature-settings: 'cv11', 'ss01', 'cv01', 'cv03', 'cv04';
    letter-spacing: -0.011em;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.02em; }

/* Scrollbars ------------------------------------------------------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; background-clip: content-box; }
.dark ::-webkit-scrollbar-thumb { background: #3f3f46; background-clip: content-box; }
.dark ::-webkit-scrollbar-thumb:hover { background: #52525b; background-clip: content-box; }

/* Focus states ------------------------------------------------------------ */
a, button, input, select, textarea { outline-color: rgb(2 121 90); }
input:focus, select:focus, textarea:focus {
    outline: none;
}

/* Global button color: rgb(2 121 90) -------------------------------------- */
:root {
    --btn-bg: rgb(2 121 90);
    --btn-bg-hover: rgb(1 98 73);
    --btn-bg-active: rgb(1 80 60);
}

button[type="submit"]:not(.btn-tab):not(.btn-icon):not(.btn-ghost) {
    background-color: var(--btn-bg) !important;
    border-color: var(--btn-bg) !important;
    color: #fff !important;
}

button[type="submit"]:not(.btn-tab):not(.btn-icon):not(.btn-ghost):hover {
    background-color: var(--btn-bg-hover) !important;
    border-color: var(--btn-bg-hover) !important;
}

button[type="submit"]:not(.btn-tab):not(.btn-icon):not(.btn-ghost):active {
    background-color: var(--btn-bg-active) !important;
    border-color: var(--btn-bg-active) !important;
}

/* Icon / ghost / tab buttons — keep transparent */
header button,
aside button[aria-label],
button.btn-ghost,
button.btn-icon,
button.btn-tab {
    background-color: transparent !important;
    border-color: transparent !important;
    color: inherit !important;
}

/* Motion ------------------------------------------------------------------ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up { animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-fade-in { animation: fadeIn 0.3s ease-out both; }

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
.animate-scale-in { animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both; }

.stagger-item { animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Skeleton loaders --------------------------------------------------------- */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
    background-size: 400% 100%;
    animation: shimmer 1.6s ease infinite;
    border-radius: 0.5rem;
}
.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 37%, #1e293b 63%);
    background-size: 400% 100%;
}

/* Cards --------------------------------------------------------------------- */
.stat-card { transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -12px rgba(38, 45, 64, 0.16); }
.dark .stat-card:hover { box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4); }

.card-hover { transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.card-hover:hover { box-shadow: 0 10px 24px -10px rgba(38, 45, 64, 0.14); transform: translateY(-2px); }

/* Soft card shadow used for panels floating on the page background ---------- */
.card-soft { box-shadow: 0 1px 2px rgba(38, 45, 64, 0.04), 0 6px 20px -12px rgba(38, 45, 64, 0.12); }
.dark .card-soft { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px -12px rgba(0, 0, 0, 0.35); }

/* Tables --------------------------------------------------------------------- */
.table-row-hover { transition: background-color 0.12s ease; }

/* Sidebar nav active indicator ------------------------------------------------ */
.nav-link { position: relative; }
.nav-link.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 9999px;
    background: rgb(2 121 90);
}

/* App shell — sidebar & navbar ------------------------------------------------ */
.app-sidebar { box-shadow: 1px 0 0 rgba(38, 45, 64, 0.04); }
.dark .app-sidebar { box-shadow: 1px 0 0 rgba(255, 255, 255, 0.04); }

.app-navbar { box-shadow: 0 1px 0 rgba(38, 45, 64, 0.04); }
.dark .app-navbar { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04); }

.panel-card { transition: box-shadow 0.2s ease, border-color 0.2s ease; }
.panel-card:hover { box-shadow: 0 8px 24px -12px rgba(38, 45, 64, 0.14); }
.dark .panel-card:hover { box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.35); }

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-radius: 0.75rem;
    padding: 0.625rem 0.75rem;
    transition: background-color 0.15s ease;
}
.list-row:hover { background-color: rgba(242, 247, 251, 0.8); }
.dark .list-row:hover { background-color: rgba(38, 45, 64, 0.35); }

.fin-metric {
    border-radius: 0.75rem;
    border: 1px solid rgba(211, 228, 242, 0.8);
    background: linear-gradient(135deg, rgba(242, 247, 251, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
    padding: 1rem;
}
.dark .fin-metric {
    border-color: rgba(64, 78, 111, 0.4);
    background: linear-gradient(135deg, rgba(38, 45, 64, 0.5) 0%, rgba(38, 45, 64, 0.2) 100%);
}

/* Gradient text / brand accents ----------------------------------------------- */
.text-gradient {
    background: linear-gradient(135deg, #495b8a 0%, #829fd2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.bg-mesh {
    background-image: radial-gradient(at 0% 0%, rgba(108, 133, 195, 0.14) 0px, transparent 50%),
        radial-gradient(at 98% 0%, rgba(130, 159, 210, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(64, 78, 111, 0.10) 0px, transparent 50%);
}

/* Number transitions ----------------------------------------------------------- */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Toast / alert entrance --------------------------------------------------------- */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-slide-in-right { animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Chart containers ------------------------------------------------------------------ */
.chart-container { position: relative; width: 100%; }

/* Avatar ring ------------------------------------------------------------------------ */
.avatar-ring { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(88, 110, 170, 0.18); }
.dark .avatar-ring { box-shadow: 0 0 0 2px #0a0a0f, 0 0 0 4px rgba(155, 184, 222, 0.2); }

/* Sidebar nav icon badges ------------------------------------------------------------ */
.nav-icon-badge { transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease; }
.nav-link:hover .nav-icon-badge { transform: scale(1.05); }

/* Utility: line clamp fallback -------------------------------------------------------- */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Print --------------------------------------------------------------------------------- */
@media print {
    aside, header, nav, .no-print { display: none !important; }
    main { padding: 0 !important; margin: 0 !important; }
    body { background: #fff !important; }
}

/* Reduce motion accessibility ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Auth / onboarding --------------------------------------------------------------------- */
.auth-grid-bg {
    background-image: radial-gradient(at 0% 0%, rgba(108, 133, 195, 0.18) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(64, 78, 111, 0.12) 0px, transparent 50%);
}
.auth-hero-glow {
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(130, 159, 210, 0.35), transparent 70%);
}
.auth-float-card {
    animation: authFloat 6s ease-in-out infinite;
}
@keyframes authFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.auth-stagger > * { animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.auth-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.auth-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.auth-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.auth-stagger > *:nth-child(4) { animation-delay: 0.2s; }

/* Brand logo on dark surfaces --------------------------------------------------------- */
.logo-on-dark {
    filter: brightness(0) invert(1);
}
.dark .logo-on-dark-when-dark {
    filter: brightness(0) invert(1);
}

/* Landing page ------------------------------------------------------------------------ */
.landing-nav {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
}
.dark .landing-nav {
    background: rgba(3, 7, 18, 0.72);
}
.landing-nav-scrolled {
    border-bottom-color: rgba(38, 45, 64, 0.08);
    box-shadow: 0 1px 3px rgba(38, 45, 64, 0.06);
}
.dark .landing-nav-scrolled {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.landing-hero {
    background: linear-gradient(135deg, rgb(1 80 60) 0%, #404e6f 50%, #262d40 100%);
}

.landing-hero-accent {
    background: linear-gradient(135deg, #b8d1e9 0%, rgb(2 121 90) 55%, #34d399 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.landing-hero-glow {
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(130, 159, 210, 0.28), transparent 70%);
}

.landing-hero-grid {
    background-image:
        radial-gradient(at 0% 0%, rgba(2, 121, 90, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(64, 78, 111, 0.25) 0px, transparent 50%),
        radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px;
    opacity: 1;
}

.landing-preview {
    transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
}
@media (max-width: 1023px) {
    .landing-preview { transform: none; }
}

.landing-feature-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.landing-feature-card:hover {
    transform: translateY(-3px);
}
.landing-feature-card--hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 48px -16px rgba(2, 121, 90, 0.35);
}

.landing-features-section {
    background: linear-gradient(180deg, transparent 0%, rgba(242, 247, 251, 0.5) 50%, transparent 100%);
}
.dark .landing-features-section {
    background: linear-gradient(180deg, transparent 0%, rgba(38, 45, 64, 0.15) 50%, transparent 100%);
}

.landing-features-bg {
    background-image:
        radial-gradient(at 0% 20%, rgba(2, 121, 90, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 80%, rgba(130, 159, 210, 0.08) 0px, transparent 50%);
}

.landing-features-bento {
    grid-auto-rows: minmax(140px, auto);
}

.landing-feature-card-glow {
    transition: opacity 0.3s ease;
}

.landing-portal-card {
    transition: box-shadow 0.25s ease;
}
.landing-portal-card:hover {
    box-shadow: 0 20px 40px -16px rgba(38, 45, 64, 0.15);
}
.dark .landing-portal-card:hover {
    box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.4);
}

.landing-cta {
    background: linear-gradient(135deg, rgb(1 80 60) 0%, rgb(2 121 90) 45%, #404e6f 100%);
}

.landing-cta-section {
    margin-top: 0;
}

.landing-cta-bg {
    background: linear-gradient(135deg, rgb(1 58 43) 0%, rgb(2 121 90) 35%, rgb(1 98 73) 65%, rgb(45 62 90) 100%);
}

.landing-cta-section::before,
.landing-cta-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    pointer-events: none;
}
.landing-cta-section::before { top: 0; }
.landing-cta-section::after { bottom: 0; }

.landing-cta-banner {
    background: linear-gradient(135deg, rgb(1 70 52) 0%, rgb(2 121 90) 40%, rgb(1 98 73) 70%, #3d4f6e 100%);
}

.landing-cta-grid {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 32px 32px;
}

.landing-cta-preview {
    box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.landing-cta-section:hover .landing-cta-preview {
    transform: translateY(-2px);
    box-shadow: 0 32px 56px -16px rgba(0, 0, 0, 0.3);
}

.landing-badge {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.landing-chart-bar {
    transition: height 0.3s ease;
    animation: chartGrow 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes chartGrow {
    from { transform: scaleY(0); transform-origin: bottom; }
    to { transform: scaleY(1); transform-origin: bottom; }
}

.landing-float-card {
    animation: authFloat 5s ease-in-out infinite;
}
.landing-float-card--tl { animation-delay: 0.5s; }
.landing-float-card--br { animation-delay: 2s; }

.landing-feature-card--featured {
    min-height: 100%;
}

.landing-plan-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.landing-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -12px rgba(2, 121, 90, 0.15);
}

.landing-calc-method {
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.landing-calc-method:hover {
    border-color: rgba(2, 121, 90, 0.3);
    transform: translateX(4px);
}

.landing-activity-feed {
    box-shadow: 0 20px 40px -20px rgba(38, 45, 64, 0.12);
}
.dark .landing-activity-feed {
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.35);
}

.landing-report-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.landing-report-card:hover {
    transform: translateY(-3px);
}

.landing-security-section {
    background: linear-gradient(180deg, rgba(242, 247, 251, 0.5) 0%, transparent 100%);
}
.dark .landing-security-section {
    background: linear-gradient(180deg, rgba(38, 45, 64, 0.2) 0%, transparent 100%);
}

.landing-security-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.landing-security-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -12px rgba(2, 121, 90, 0.12);
}

.landing-testimonial {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.landing-testimonial:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -12px rgba(38, 45, 64, 0.1);
}

.landing-step-connector {
    z-index: 0;
}

/* How-it-works steps -------------------------------------------------------- */
.landing-steps-section {
    background: linear-gradient(180deg, rgba(242, 247, 251, 0.4) 0%, transparent 100%);
}
.dark .landing-steps-section {
    background: linear-gradient(180deg, rgba(38, 45, 64, 0.12) 0%, transparent 100%);
}

.landing-steps-bg {
    background-image:
        radial-gradient(at 20% 50%, rgba(2, 121, 90, 0.05) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(130, 159, 210, 0.06) 0px, transparent 50%);
}

.landing-steps-track {
    isolation: isolate;
}

.landing-step-card {
    position: relative;
    z-index: 1;
}

.landing-steps-rail {
    z-index: 0;
}

@media (max-width: 767px) {
    .landing-step-card::before {
        content: '';
        position: absolute;
        left: 2rem;
        top: 5.5rem;
        bottom: -1.5rem;
        width: 2px;
        background: linear-gradient(180deg, rgba(2, 121, 90, 0.25), rgba(2, 121, 90, 0.05));
    }
    .landing-step-card:last-child::before {
        display: none;
    }
}

.landing-cta-pattern {
    background-image:
        radial-gradient(ellipse 80% 60% at 15% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(2, 121, 90, 0.2) 0%, transparent 45%);
}

.landing-portal-mockup {
    min-height: 280px;
}
