/* ============================================================
   CryptoPlexTrade – Global Responsive Stylesheet
   Applied to all public pages via <link rel="stylesheet">
   Breakpoints: 900px (tablet), 640px (mobile)
   ============================================================ */

/* ── Box-sizing safety net ── */
*, *::before, *::after { box-sizing: border-box; }

/* ══════════════════════════════════════════════════════════
   0. GLOBAL LOGO SIZING
   ══════════════════════════════════════════════════════════ */

/* Desktop – make the logo more prominent and visible */
img.logo,
img.sidebar-brand__orb,
img.os-brand__orb,
img.brand-orb,
img.brand-circle {
    height: 56px !important;
    max-height: 56px !important;
    width: auto !important;
    border-radius: 14px !important;
    object-fit: contain !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
    transition: transform 0.3s ease;
}

img.logo:hover,
img.sidebar-brand__orb:hover,
img.os-brand__orb:hover,
img.brand-orb:hover,
img.brand-circle:hover {
    transform: scale(1.05);
}

@media (max-width: 900px) {
    img.logo,
    img.sidebar-brand__orb,
    img.os-brand__orb,
    img.brand-orb,
    img.brand-circle {
        height: 44px !important;
        max-height: 44px !important;
    }
}

@media (max-width: 640px) {
    img.logo,
    img.sidebar-brand__orb,
    img.os-brand__orb,
    img.brand-orb,
    img.brand-circle {
        height: 38px !important;
        max-height: 38px !important;
        border-radius: 10px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   1. HEADER & NAV
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .header .container,
    .header > .container { gap: 12px; }

    /* Public-page nav: collapse links */
    .nav, .header-nav { gap: 8px; }
    .nav a, .header-nav a { margin-left: 12px; font-size: .83rem; }

    /* Hide "Get Started" btn text, keep it as icon pill */
    .nav .btn-cta, .header-nav .btn-cta { padding: 7px 14px; font-size: .78rem; }
}

@media (max-width: 640px) {
    /* Stack header into two rows */
    .header .container,
    .header > .container {
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 8px;
    }

    .logo-name { font-size: .95rem !important; }

    /* Hide most nav links on very small screens, keep Login + CTA */
    .nav a:not(.btn-cta):not([href*="login"]):not(#logout-btn),
    .header-nav a:not(.btn-cta):not([href*="login"]):not(#logout-btn) {
        display: none;
    }

    .nav, .header-nav { margin-left: auto; }
}

/* ══════════════════════════════════════════════════════════
   2. DASHBOARD SIDEBAR → off-canvas drawer on mobile
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    /* Convert layout to column so content fills screen */
    .dashboard-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 70px);
    }

    /* Sidebar becomes a compact horizontal icon bar at the top */
    .dashboard-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 8px 12px;
        border-right: none;
        border-bottom: 1px solid rgba(0,91,170,.12);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
    }

    .sidebar-nav { width: 100%; }
    .sidebar-nav ul {
        display: flex;
        flex-direction: row;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
        margin: 0;
    }

    .sidebar-nav li { flex-shrink: 0; }

    .sidebar-nav a {
        flex-direction: column;
        padding: 8px 12px;
        font-size: .72rem;
        gap: 4px;
        margin-bottom: 0;
        border-radius: 10px;
        text-align: center;
        white-space: nowrap;
    }

    .sidebar-nav a svg {
        width: 20px !important;
        height: 20px !important;
        margin-right: 0 !important;
    }

    /* Dashboard content takes full width */
    .dashboard-content {
        padding: 20px 16px 80px;
        overflow-y: visible;
    }
}

@media (max-width: 640px) {
    .dashboard-header h1 { font-size: 1.35rem !important; }
    .dashboard-header p  { font-size: .86rem !important; }
}

/* ══════════════════════════════════════════════════════════
   3. DASHBOARD WIDGETS & STAT CARDS
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    /* 3/4-column → 2-column */
    .stats-grid, .widget-grid, .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    /* → 1-column on phones */
    .stats-grid, .widget-grid, .kpi-grid,
    .profile-grid, .content-grid, .two-col-grid {
        grid-template-columns: 1fr !important;
    }

    /* Stat / KPI cards smaller padding */
    .stat-card, .kpi-card, .market-card, .info-card {
        padding: 18px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   4. CONTACT PAGE – form ↔ info card layout
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .content-wrap {
        grid-template-columns: 1fr !important;
        padding: 0 16px 80px !important;
    }
    .info-col { order: 2; }   /* push info cards below the form */
    .form-col  { order: 1; }
}

/* ══════════════════════════════════════════════════════════
   5. PROFILE GRID
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .profile-grid { grid-template-columns: 1fr !important; gap: 18px !important; }
}

/* ══════════════════════════════════════════════════════════
   6. PAYMENT METHOD CARDS
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .payment-options {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   7. TRANSACTIONS TABLE – horizontal scroll
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .table-container {
        padding: 16px 12px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .transactions-table {
        min-width: 680px;
        font-size: .82rem;
    }

    .transactions-table th,
    .transactions-table td {
        padding: 10px 8px !important;
    }

    .filter-controls {
        flex-wrap: wrap;
        gap: 10px !important;
        padding: 14px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   8. TRADE PAGE – split layout → single column
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .split-layout {
        grid-template-columns: 1fr !important;
        overflow: visible !important;
        min-height: unset !important;
    }

    .split-layout__left {
        display: none !important;   /* hide decorative left pane */
    }

    .split-layout__right {
        padding: 24px 16px 100px !important;
        justify-content: flex-start !important;
    }

    .form-container {
        max-width: 100% !important;
        padding: 22px 18px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   9. CONFIRMATION / STEPPER PAGES
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .confirmation-wrapper {
        padding: 20px 16px !important;
        border-radius: 16px !important;
    }

    .confirmation-wrapper h1 {
        font-size: 1.4rem !important;
        margin-bottom: 16px !important;
    }

    .step-title { font-size: .72rem !important; }
    .step-number { width: 30px !important; height: 30px !important; font-size: .82rem !important; }

    .main-content { padding: 20px 0 80px !important; }
}

/* ══════════════════════════════════════════════════════════
   10. FAQ ACCORDION + SEARCH
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .faq-search { padding: 0 16px !important; }
    .faq-search input { font-size: .9rem; padding: 12px 14px 12px 42px !important; }

    .category-tabs { gap: 6px !important; flex-wrap: wrap; }
    .category-tab  { padding: 6px 14px !important; font-size: .78rem !important; }

    .faq-section  { padding: 16px !important; }
    .faq-question { font-size: .9rem !important; }
}

/* ══════════════════════════════════════════════════════════
   11. CONTACT HERO BANNER
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .hero-banner { padding: 28px 16px !important; }
    .hero-banner h1 { font-size: 1.8rem !important; }
    .hero-banner p  { font-size: .9rem !important; }
}

/* ══════════════════════════════════════════════════════════
   12. HELP PAGE CATEGORY CARDS
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .help-categories { grid-template-columns: 1fr 1fr !important; }
    .cta-banner { padding: 28px 16px !important; }
    .cta-banner h2 { font-size: 1.3rem !important; }
}

/* ══════════════════════════════════════════════════════════
   13. TERMS / PRIVACY – sticky side-nav → top tab
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .page-layout, .terms-layout, .privacy-layout {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .side-nav, .page-side-nav {
        position: static !important;
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(0,91,170,.12);
        max-height: 200px;
        overflow-y: auto;
        padding: 12px !important;
    }

    .side-nav ul, .page-side-nav ul { display: flex; flex-wrap: wrap; gap: 4px; }
    .side-nav li, .page-side-nav li { flex-shrink: 0; }
    .side-nav a, .page-side-nav a {
        padding: 5px 12px !important;
        border-left: none !important;
        border-radius: 20px;
        background: rgba(0,91,170,.06);
        font-size: .78rem;
    }
    .side-nav a.active, .page-side-nav a.active {
        background: var(--blue-main, #005baa);
        color: #fff !important;
    }
}

/* ══════════════════════════════════════════════════════════
   14. REGISTER / LOGIN / AUTH PAGES – split layout
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .login-split-layout, .register-split-layout, .auth-split {
        flex-direction: column !important;
    }
    .login-split-layout__left, .register-split-layout__left {
        padding: 32px 20px !important;
        min-height: unset !important;
        flex: none !important;
    }
    .login-split-layout__right, .register-split-layout__right {
        flex: 1 !important;
        padding: 24px 20px !important;
    }
    .form-container {
        max-width: 100% !important;
        padding: 24px 18px !important;
        margin: 0 !important;
    }
}

@media (max-width: 640px) {
    /* Show single-panel full-screen card for login / register */
    .login-split-layout__left, .register-split-layout__left { display: none !important; }
    .login-split-layout, .register-split-layout { min-height: 100vh !important; }
}

/* ══════════════════════════════════════════════════════════
   15. SUPPORT TICKET LIST & MODAL
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .support-header { flex-direction: column; align-items: flex-start; gap: 10px !important; }
    .ticket-item { flex-direction: column; align-items: flex-start !important; gap: 8px; }
    .ticket-status { align-self: flex-start; }

    .modal-content { padding: 20px 14px !important; border-radius: 16px !important; }
    .message-item { padding: 12px !important; }
    .message-header { flex-direction: column; gap: 2px !important; }
}

/* ══════════════════════════════════════════════════════════
   16. FORM INPUTS – Touch-friendly sizing
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    input, select, textarea {
        font-size: 16px !important; /* prevents iOS zoom on focus */
        min-height: 44px;
    }
    textarea { min-height: 100px !important; }

    .btn-primary, .btn-send, .login-btn, .btn-cta {
        width: 100%;
        text-align: center;
        padding: 14px 20px !important;
    }

    /* Narrow forms: full-width on mobile */
    .form-options {
        flex-direction: column;
        gap: 8px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   17. INDEX (HOMEPAGE) – hero, rates, floating icons
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .hero { flex-direction: column !important; text-align: center; }
    .hero-text { padding: 40px 20px 20px !important; max-width: 100% !important; }
    .hero-text h1 { font-size: 2.4rem !important; }
    .hero-cta { justify-content: center; }
    .hero-visual { display: none; }

    .rates-grid { grid-template-columns: repeat(2,1fr) !important; }
    .features-grid { grid-template-columns: repeat(2,1fr) !important; }
}

@media (max-width: 640px) {
    .hero-text h1 { font-size: 1.8rem !important; }
    .hero-text p  { font-size: .95rem !important; }
    .rates-grid   { grid-template-columns: 1fr !important; }
    .features-grid { grid-template-columns: 1fr !important; }
    .floating-icons { display: none !important; }
    .scroll-indicator { display: none !important; }

    /* Section headings */
    .section-title { font-size: 1.6rem !important; }
}

/* ══════════════════════════════════════════════════════════
   18. LEGAL PAGES (AML, TERMS, PRIVACY) – card padding
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .legal-container {
        padding: 20px 16px !important;
        border-radius: 12px !important;
    }
    .legal-container h1 { font-size: 1.5rem !important; }
    .legal-container h2 { font-size: 1.1rem !important; }
}

/* ══════════════════════════════════════════════════════════
   19. TICKER TAPE – global keyframes + mobile overrides
   NOTE: @keyframes must be at root level — they are ignored
   when nested inside @media blocks.
   ══════════════════════════════════════════════════════════ */

/* Global keyframe definition — works on all screen sizes */
@-webkit-keyframes scroll-ticker {
    0%   { -webkit-transform: translateX(0);    transform: translateX(0); }
    100% { -webkit-transform: translateX(-50%); transform: translateX(-50%); }
}
@keyframes scroll-ticker {
    0%   { -webkit-transform: translateX(0);    transform: translateX(0); }
    100% { -webkit-transform: translateX(-50%); transform: translateX(-50%); }
}

@media (max-width: 640px) {
    .ticker-tape {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        /* Force GPU layer so iOS doesn't drop it */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .ticker-tape__track {
        display: inline-block !important;
        white-space: nowrap !important;
        width: max-content !important;
        min-width: 200% !important;
        -webkit-animation: scroll-ticker 30s linear infinite !important;
        animation: scroll-ticker 30s linear infinite !important;
        -webkit-animation-play-state: running !important;
        animation-play-state: running !important;
    }
    .ticker-tape__item {
        padding: 0 12px !important;
        font-size: .75rem !important;
        display: inline-flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }
}

/* ══════════════════════════════════════════════════════════
   20. MISC – register-success, forgot-password, reset-password
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .success-card, .reset-card, .forgot-card {
        padding: 24px 16px !important;
        margin: 20px 12px !important;
    }

    .success-icon { width: 64px !important; height: 64px !important; }
    .success-card h1 { font-size: 1.4rem !important; }

    /* Confirmation wrapper small */
    .confirmation-section { padding: 16px !important; }
    .confirmation-section h2 { font-size: 1.1rem !important; }

    .detail-item .value { font-size: .85rem !important; }
}
