/* ===== RESET & VARIABLES ===== */
:root {
    --bg-dark: #0B1120;
    --bg-card: #111827;
    --primary: #3B82F6;
    --primary-glow: rgba(59, 130, 246, 0.3);
    --text-light: #E5E7EB;
    --text-muted: #9CA3AF;
    --border-light: rgba(255, 255, 255, 0.1);
    --positive: #10B981;
    --negative: #EF4444;
    --font-main: 'Instrument Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ===== TYPOGRAPHY ===== */
h1 { font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 900; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 5vw, 2.25rem); font-weight: 700; margin-bottom: 0.5rem; }
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }
a { text-decoration: none; color: inherit; }

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 0 15px var(--primary-glow);
}
.btn-primary:hover { background: #2563EB; transform: translateY(-2px); box-shadow: 0 5px 20px var(--primary-glow); }
.btn-primary.large { padding: 0.875rem 2rem; font-size: 1rem; }

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--text-light);
    padding: 0.625rem 1.25rem;
    border-radius: 2rem;
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
    text-align: center;
}
.btn-outline:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.3); }
.full-width { width: 100%; }

/* ===== HEADER ===== */
.site-header {
    background: rgba(11, 17, 32, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
}
.logo { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; color: white; }

/* Desktop Navigation */
.desktop-nav {
    display: none;
    gap: 1.5rem;
}
.desktop-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}
.desktop-nav a:hover { color: white; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Hamburger Button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}
.hamburger span {
    width: 1.75rem;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger[aria-expanded="true"] span:first-child { transform: rotate(45deg) translate(5px, 5px); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:last-child { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu Overlay - FULL HEIGHT GUARANTEED */
.mobile-menu {
    position: fixed;
    top: 4.5rem;                /* directly below header */
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - 4.5rem); /* explicitly set height */
    max-height: calc(100vh - 4.5rem);
    background: var(--bg-dark);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 99;
    overflow-y: auto;
    padding: 1.5rem 1.5rem 2rem;
    border-top: 1px solid var(--border-light);
    box-shadow: inset 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 1rem;
    flex: 1;                    /* take available space */
}

.mobile-menu a {
    font-size: 1.25rem;
    font-weight: 500;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-light);
    transition: color 0.2s, padding-left 0.2s;
}

.mobile-menu a:hover {
    color: var(--primary);
    padding-left: 0.75rem;
}

.mobile-actions {
    margin-top: auto;            /* push to bottom if needed, but keep after nav */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-actions .btn-outline,
.mobile-actions .btn-primary {
    display: block;
    text-align: center;
    padding: 0.875rem;
    font-size: 1rem;
}

/* Scroll hint shadow */
.mobile-menu::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: block;
    height: 40px;
    background: linear-gradient(to top, var(--bg-dark) 20%, transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.mobile-menu.scrollable::after {
    opacity: 1;
}

/* ===== RESPONSIVE NAVIGATION ===== */
@media (max-width: 1023px) {
    .desktop-nav {
        display: none !important;
    }

    .hamburger {
        display: flex !important;
    }

    /* Always show both Login and Get Started buttons on mobile */
    .header-actions .btn-outline,
    .header-actions .btn-primary {
        display: inline-block !important;
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .header-container {
        padding: 0 0.75rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .header-actions {
        gap: 0.5rem;
    }
}

/* For very small screens, keep both buttons but reduce padding slightly */
@media (max-width: 380px) {
    .header-actions .btn-outline,
    .header-actions .btn-primary {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }

    .header-actions {
        gap: 0.35rem;
    }

    .hamburger {
        width: 1.75rem;
        height: 1.75rem;
    }

    .hamburger span {
        width: 1.5rem;
    }

    .logo {
        font-size: 1.1rem;
    }
}

@media (min-width: 1024px) {
    .desktop-nav { display: flex; }
    .hamburger { display: none !important; }
    .mobile-menu { display: none; }
    .header-actions .btn-outline,
    .header-actions .btn-primary {
        display: inline-block;
    }
}

/* ===== HERO ===== */
.hero { padding: 2rem 0 4rem; background: radial-gradient(circle at 30% 20%, rgba(59,130,246,0.15) 0%, transparent 50%); }
.hero-grid { display: flex; flex-direction: column; gap: 2rem; }
.hero-content h1 { margin-bottom: 1rem; }
.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 600px;
}
.hero-stats { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.stat-badge { background: rgba(255,255,255,0.05); padding: 0.5rem 1rem; border-radius: 2rem; font-size: 0.875rem; font-weight: 500; border: 1px solid var(--border-light); }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.hero-chart {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 0.5rem;
    border: 1px solid var(--border-light);
}
#tradingview-chart {
    border-radius: 0.75rem;
    overflow: hidden;
    width: 100%;
}

@media (min-width: 1024px) {
    .hero-grid {
        display: grid;
        grid-template-columns: 1fr 1.2fr;
        align-items: center;
    }
}

/* ===== MARKET OVERVIEW ===== */
.market-overview { padding: 3rem 0; }
.section-header { margin-bottom: 2rem; }
.section-header p { color: var(--text-muted); }
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
}
.market-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.market-table th {
    text-align: left;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}
.market-table td { padding: 1rem; border-top: 1px solid var(--border-light); }
.coin-name { display: flex; align-items: center; gap: 0.5rem; }
.symbol { color: var(--text-muted); font-size: 0.75rem; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }

/* ===== RECENT ACTIVITY CARD DESIGN ===== */
.recent-activity {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-top: 2rem;
}
.recent-activity h3 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.recent-activity h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.activity-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.activity-item:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
    transform: translateX(4px);
}
.activity-user {
    font-weight: 600;
    font-size: 1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.activity-user::before {
    content: '●';
    color: var(--positive);
    font-size: 0.75rem;
    animation: pulse-neon 2s infinite;
}
.activity-action {
    font-size: 0.9375rem;
    color: var(--text-muted);
    padding-left: 1.25rem;
}
.activity-action strong {
    color: var(--primary);
    font-weight: 700;
}
@keyframes pulse-neon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== FEATURES ===== */
.features { padding: 3rem 0 5rem; }
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    transition: all 0.3s;
}
.feature-card:hover { border-color: var(--primary); box-shadow: 0 0 30px var(--primary-glow); transform: translateY(-5px); }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card p { color: var(--text-muted); font-size: 0.9375rem; }
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }

/* ===== FOOTER ===== */
.site-footer { background: var(--bg-card); border-top: 1px solid var(--border-light); padding: 3rem 0 1.5rem; }
.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2.5rem;
}
.footer-col h4 { font-size: 1rem; margin-bottom: 1rem; color: white; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text-muted); font-size: 0.875rem; transition: color 0.2s; }
.footer-col a:hover { color: white; }
.footer-bottom { text-align: center; padding-top: 1.5rem; border-top: 1px solid var(--border-light); color: var(--text-muted); font-size: 0.875rem; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

/* ===== LOGIN PAGE ===== */
.login-section {
    min-height: calc(100vh - 4.5rem - 300px);
    display: flex;
    align-items: center;
    padding: 2rem 0;
}
.login-container { display: flex; justify-content: center; }
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 2rem;
    padding: 2.5rem 2rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.login-title { font-size: 2rem; font-weight: 900; text-align: center; margin-bottom: 0.5rem; color: white; }
.login-subtitle { font-size: 1.5rem; font-weight: 600; text-align: center; margin-bottom: 0.5rem; }
.login-description { text-align: center; color: var(--text-muted); margin-bottom: 2rem; font-size: 0.9375rem; }
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.form-group input, .form-group select {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group input::placeholder { color: var(--text-muted); opacity: 0.6; }
.form-group input:disabled { opacity: 0.6; cursor: not-allowed; }

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}
.form-group select option { background: var(--bg-dark); color: white; }

.form-options { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; color: var(--text-muted); }
.checkbox-label input { width: 1rem; height: 1rem; accent-color: var(--primary); }
.forgot-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.forgot-link:hover { text-decoration: underline; }
.signup-prompt { text-align: center; margin-top: 1rem; color: var(--text-muted); font-size: 0.9375rem; }
.signup-prompt a { color: var(--primary); font-weight: 600; }
.secure-badge {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--positive);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ===== REGISTER PAGE ===== */
.register-section {
    min-height: calc(100vh - 4.5rem - 300px);
    display: flex;
    align-items: center;
    padding: 2rem 0;
}
.register-container { display: flex; justify-content: center; }
.register-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 2rem;
    padding: 2.5rem 2rem;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.register-title { font-size: 2rem; font-weight: 900; text-align: center; margin-bottom: 0.5rem; color: white; }
.register-description { text-align: center; color: var(--text-muted); margin-bottom: 2rem; font-size: 0.9375rem; }
.register-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-agreement { margin: 0.5rem 0; }
.form-agreement .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}
.form-agreement .checkbox-label input { margin-top: 0.2rem; flex-shrink: 0; }
.login-prompt { text-align: center; margin-top: 1rem; color: var(--text-muted); font-size: 0.9375rem; }
.login-prompt a { color: var(--primary); font-weight: 600; }

/* Validation message styles */
.phone-validation-message {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}
.phone-valid { color: var(--positive); }
.phone-invalid { color: var(--negative); }
.phone-hint { color: var(--text-muted); }
input:invalid { border-color: var(--negative) !important; }
input:valid { border-color: var(--positive) !important; }

@media (max-width: 480px) {
    .login-card, .register-card { padding: 1.5rem; }
    .login-title, .register-title { font-size: 1.75rem; }
    .form-options { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}