/* ============================================
   TRADE MATRIX SYSTEM — Design System
   Premium FinTech Dark-Mode SaaS UI
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0B1220;
    --bg-secondary: #0E1628;
    --bg-card: #121A2B;
    --bg-card-hover: #182236;
    --bg-elevated: #1A2438;
    --accent: #00E0FF;
    --accent-dim: rgba(0, 224, 255, 0.15);
    --accent-glow: rgba(0, 224, 255, 0.4);
    --success: #00C853;
    --success-dim: rgba(0, 200, 83, 0.15);
    --danger: #FF5252;
    --danger-dim: rgba(255, 82, 82, 0.15);
    --warning: #FFB300;
    --text-primary: #E6EDF6;
    --text-secondary: #9AA4B2;
    --text-muted: #5E6A7A;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(0, 224, 255, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(0, 224, 255, 0.15);
    --glass-bg: rgba(18, 26, 43, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 16px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Sora', sans-serif;
    --font-body: 'Inter', sans-serif;
    --container-max: 1200px;
    --container-lg: 1400px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #33E8FF;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

input,
button,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* --- Utility Classes --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.container-lg {
    max-width: var(--container-lg);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
}

.section-sm {
    padding: 60px 0;
}

.text-center {
    text-align: center;
}

.text-accent {
    color: var(--accent);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

.gap-24 {
    gap: 24px;
}

.gap-32 {
    gap: 32px;
}

.gap-40 {
    gap: 40px;
}

.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.relative {
    position: relative;
}

.overflow-hidden {
    overflow: hidden;
}

.w-full {
    width: 100%;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

h4 {
    font-size: 1.125rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #00B8D4);
    color: var(--bg-primary);
    box-shadow: 0 4px 20px rgba(0, 224, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 224, 255, 0.5);
    color: var(--bg-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-outline-accent {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline-accent:hover {
    background: var(--accent-dim);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 224, 255, 0.2);
}

.btn-sm {
    padding: 10px 24px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 1.05rem;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn .btn-icon {
    width: 18px;
    height: 18px;
}

/* Button ripple */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.3s;
    border-radius: inherit;
}

.btn:active::after {
    transform: scale(2.5);
    opacity: 1;
    transition: 0s;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all var(--transition-base);
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all var(--transition-base);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239AA4B2' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    border-radius: 4px;
    cursor: pointer;
}

/* --- Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-accent {
    background: var(--accent-dim);
    color: var(--accent);
}

.badge-success {
    background: var(--success-dim);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-dim);
    color: var(--danger);
}

/* --- Alert --- */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(255, 82, 82, 0.2);
}

.alert-success {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid rgba(0, 200, 83, 0.2);
}

.alert-info {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 224, 255, 0.2);
}

/* --- Grid Background Pattern --- */
.grid-bg {
    background-image:
        linear-gradient(rgba(0, 224, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 224, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* --- Glow Decorations --- */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.glow-cyan {
    background: rgba(0, 224, 255, 0.08);
}

.glow-blue {
    background: rgba(56, 97, 251, 0.08);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 224, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 224, 255, 0.4);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes candlestick {

    0%,
    100% {
        height: 40%;
    }

    25% {
        height: 70%;
    }

    50% {
        height: 30%;
    }

    75% {
        height: 60%;
    }
}

@keyframes chart-line {
    from {
        stroke-dashoffset: 1000;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes counter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal[style*="animation-delay: 0.1s"] {
    transition-delay: 0.1s;
}

.reveal[style*="animation-delay: 0.2s"] {
    transition-delay: 0.2s;
}

.reveal[style*="animation-delay: 0.3s"] {
    transition-delay: 0.3s;
}

.reveal[style*="animation-delay: 0.4s"] {
    transition-delay: 0.4s;
}

.reveal[style*="animation-delay: 0.5s"] {
    transition-delay: 0.5s;
}

.reveal[style*="animation-delay: 0.6s"] {
    transition-delay: 0.6s;
}

.reveal[style*="animation-delay:0.1s"] {
    transition-delay: 0.1s;
}

.reveal[style*="animation-delay:0.2s"] {
    transition-delay: 0.2s;
}

.reveal[style*="animation-delay:0.3s"] {
    transition-delay: 0.3s;
}

.reveal[style*="animation-delay:0.4s"] {
    transition-delay: 0.4s;
}

.reveal[style*="animation-delay:0.5s"] {
    transition-delay: 0.5s;
}

.reveal[style*="animation-delay:0.6s"] {
    transition-delay: 0.6s;
}

/* --- Pricing Toggle --- */
.toggle-wrapper {
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 0;
}

.toggle-btn {
    padding: 10px 28px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent), #00B8D4);
    color: var(--bg-primary);
    box-shadow: 0 2px 12px rgba(0, 224, 255, 0.3);
}

/* --- Accordion --- */
.accordion-item {
    border-bottom: 1px solid var(--border-color);
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: color var(--transition-fast);
}

.accordion-header:hover {
    color: var(--accent);
}

.accordion-header svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
    color: var(--text-muted);
}

.accordion-item.active .accordion-header svg {
    transform: rotate(180deg);
    color: var(--accent);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.accordion-item.active .accordion-body {
    max-height: 500px;
}

.accordion-content {
    padding: 0 0 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- Icon Box --- */
.icon-box {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border-radius: var(--radius-md);
    color: var(--accent);
    flex-shrink: 0;
}

.icon-box svg {
    width: 24px;
    height: 24px;
}

.icon-box-lg {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
}

.icon-box-lg svg {
    width: 28px;
    height: 28px;
}

/* --- Divider --- */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 40px 0;
}

/* --- Section Header --- */
.section-header {
    max-width: 640px;
    margin: 0 auto 60px;
    text-align: center;
}

.section-header .label {
    margin-bottom: 12px;
    display: block;
}

.section-header h2 {
    margin-bottom: 16px;
}

.section-header p {
    font-size: 1.05rem;
}

/* --- Stats --- */
.stat-card {
    text-align: center;
    padding: 24px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 16px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 14px 32px;
        font-size: 0.95rem;
    }

    .glass-card,
    .card {
        padding: 24px;
    }

    .section-header {
        margin-bottom: 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .glass-card,
    .card {
        padding: 20px;
    }

    .stat-value {
        font-size: 2rem;
    }
}