/**
 * modern-ui.css - Trust Navy + Gold redesign layer (world of DESIGN.md).
 * Load AFTER each layout's stylesheets (dark theme + admin).
 * Palette-safe: transparent / white alphas / currentColor only.
 * No copy changes. Radius scale, focus visibility, press feedback,
 * smoother theme motion, mobile-first input sizing.
 */

/* ---------- Buttons: modern radius + press feedback ---------- */
.cmn-btn {
    border-radius: 10px;
    transition: transform 150ms ease-out;
}
.cmn-btn:active {
    transform: scale(0.98);
}

/* ---------- Forms: radius, 16px (no iOS auto-zoom), visible focus ---------- */
.form-control,
.form-select,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"] {
    border-radius: 10px;
    font-size: 16px;
}
.form-control:focus,
.form-select:focus,
select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

/* ---------- Keyboard focus everywhere ---------- */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ---------- Cards: radius scale ---------- */
.card {
    --bs-card-border-radius: 14px;
    border-radius: 14px;
}
.cmn__card .card__header {
    border-radius: 12px 12px 0 0;
}
.cmn__card .card__body {
    border-radius: 0 0 12px 12px;
}
.cmn__card .card__body:first-child {
    border-radius: 12px !important;
}

/* ---------- Modals / dropdowns / alerts / tabs ---------- */
.modal-content {
    border-radius: 14px;
}
.dropdown-menu {
    border-radius: 10px;
}
.dropdown-item {
    transition: background-color 150ms ease-out, color 150ms ease-out;
}
.alert {
    border-radius: 10px;
}
.nav-tabs .nav-link {
    border-radius: 10px 10px 0 0;
    transition: background-color 150ms ease-out, border-color 150ms ease-out;
}

/* ---------- Header/sidebar menu: smooth the theme's slide, bigger targets ---------- */
.menu li a {
    padding-top: 8px;
    padding-bottom: 8px;
    transition: color 160ms ease-out;
}
.menu li .submenu {
    border-radius: 10px;
}
.menu li .submenu li a {
    transition: transform 160ms ease-out, color 160ms ease-out;
}
.menu li .submenu li a:hover {
    padding-left: 15px;
    transform: translateX(6px);
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .cmn-btn,
    .dropdown-item,
    .nav-tabs .nav-link,
    .menu li a,
    .menu li .submenu li a {
        transition: none !important;
    }
}

/* ============================================================
   Trust Navy + Gold world - type system (DESIGN.md)
   Display: Lexend | Body: Source Sans 3 (self-hosted, latin)
   ============================================================ */

/* ---------- Self-hosted type (only used faces & weights) ---------- */
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/source-sans-3-var-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Lexend';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/lexend-var-latin.woff2') format('woff2');
}

/* ---------- Roles: body = Source Sans 3, display = Lexend ---------- */
body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    letter-spacing: 0.006em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6,
.account-title,
.account-subtitle {
    font-family: 'Lexend', 'Source Sans 3', -apple-system, 'Segoe UI', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); letter-spacing: -0.02em; }
h3, h4 { letter-spacing: -0.01em; }
.account-title { letter-spacing: -0.01em; }
.cmn-btn {
    font-family: 'Lexend', 'Source Sans 3', -apple-system, 'Segoe UI', sans-serif;
    font-weight: 600;
}

/* Light-on-dark compensation: a touch more weight on small roles */
.form-label,
label {
    font-weight: 500;
}

/* ---------- Browser surfaces: selection, caret, scrollbars, numerals ---------- */
::selection {
    background: #4682b4;
    color: #ffffff;
}
input,
textarea,
[contenteditable] {
    caret-color: #4682b4;
}
html {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    scrollbar-width: thin;
}
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.32);
    background-clip: padding-box;
    border: 2px solid transparent;
}
a {
    text-underline-offset: 3px;
}
.table th,
.table td {
    font-variant-numeric: tabular-nums;
}

/* ---------- Data surfaces: Swiss table rhythm ---------- */
.table {
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
}
.table > :not(caption) > * > * {
    padding: 12px 16px;
    line-height: 1.5;
    vertical-align: middle;
}
.table thead th {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.table tbody tr {
    transition: background-color 150ms ease-out;
}

/* ---------- Elevation: floating layers only (cards keep their border) ---------- */
.dropdown-menu,
.modal-content {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

/* ---------- Controls: radius + press across the app ---------- */
.btn {
    border-radius: 10px;
    transition: transform 150ms ease-out, background-color 150ms ease-out,
        border-color 150ms ease-out, color 150ms ease-out;
}
.btn:active {
    transform: scale(0.98);
}
.menu li a {
    border-radius: 8px;
}

/* ============================================================
   TRUST NAVY + GOLD — redesigned world (see DESIGN.md)
   ============================================================ */
:root {
    --page: #0F172A;
    --surface: #16233F;
    --surface-2: #1C2B4A;
    --well: #0D1526;
    --text: #FFFFFF;
    --text-2: #C3D0E8;
    --muted: #8FA0BC;
    --secondary: #1E3A8A;
    --accent: #4682b4;
    --accent-text: #6FA3D6;
    --accent-deep: #3A6B96;
    --danger: #DC2626;
}

/* Page sits deeper than its panels */
body {
    background: var(--page);
}

/* Gold CTAs — the world's action color */
.cmn-btn {
    background: var(--accent);
}
.cmn-btn:hover,
.cmn-btn:focus {
    background: var(--accent-deep);
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    color: #ffffff;
}

/* Theme link color: gold tint for 4.5:1 on navy */
.text--base {
    color: var(--accent-text);
}
.text--base:hover {
    color: var(--accent);
}

/* ============================================================
   Trust Navy header (user layout)
   ============================================================ */
header {
    top: 0;
    background: rgba(22, 35, 63, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
header.active {
    background: #16233F;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header__wrapper {
    min-height: 72px;
    gap: 1rem;
}

.menu > li > a {
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
}
.menu > li > a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent-text);
}

.menu li .submenu {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}
.menu li .submenu li a {
    padding: 9px 15px;
}

.account-dropdown .dropdown-menu {
    background-color: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.account-dropdown .dropdown-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767px) {
    .header__wrapper .right__side {
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 0.2rem;
    }
    .header__wrapper .right__side .header-bar {
        margin-left: 0;
    }
    .header__wrapper .right__side .account .ml-20 {
        margin-left: 0 !important;
    }
    .menu {
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
    }
    .menu > li > a {
        padding: 12px 0;
    }
    .account-dropdown .dropdown-menu {
        min-width: min(299px, calc(100vw - 2rem));
    }
}

/* Mobile nav: backdrop + modern dropdown panel */
.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 97;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease-out, visibility 200ms ease-out;
}
.nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}
body.nav-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        background: var(--surface);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
        padding: 12px;
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px) scale(0.98);
        transform-origin: top right;
        transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms ease-out, visibility 0s linear 220ms;
    }
    .menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms ease-out, visibility 0s;
    }

    .menu > li {
        width: 100%;
        margin: 0;
    }
    .menu > li + li {
        margin-top: 2px;
    }
    .menu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 12px;
        margin-bottom: 0;
        font-size: 16px;
        border-bottom: 0;
        border-radius: 10px;
    }

    .menu-item-has-children .submenu {
        position: static;
        min-width: 0;
        background: rgba(255, 255, 255, 0.03);
        border: 0;
        box-shadow: none;
        border-radius: 10px;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 240ms ease-out;
    }
    .menu-item-has-children.open .submenu {
        max-height: 500px;
    }
    .menu-item-has-children .submenu li a {
        padding: 12px 16px;
        color: var(--text-2);
    }
    .menu-item-has-children .submenu li a:hover {
        color: var(--accent-text);
    }

    .menu-item-has-children > a::after {
        transition: transform 200ms ease-out;
    }
    .menu-item-has-children.open > a::after {
        transform: rotate(180deg);
    }
}

/* Coming soon modal */
.coming-soon {
    position: relative;
    padding: 2.5rem 2rem 2rem;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text);
    text-align: center;
}
.coming-soon .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}
.coming-soon__mark {
    width: 76px;
    height: 76px;
    margin: 0 auto 1.25rem;
    color: var(--accent);
}
.coming-soon__mark svg {
    display: block;
    width: 100%;
    height: 100%;
}
.coming-soon__title {
    margin: 0 0 0.5rem;
    color: var(--text);
    font-family: 'Lexend', 'Source Sans 3', -apple-system, 'Segoe UI', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.coming-soon__text {
    margin: 0 auto 1.5rem;
    max-width: 42ch;
    color: var(--text-2);
    line-height: 1.6;
}
.coming-soon .cmn-btn {
    min-width: 160px;
}

/* Exchange modals (Sell / Swap) */
.exchange-modal {
    max-width: 500px;
}
.exchange-modal__content {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text);
    overflow: hidden;
}
#modalTwo .exchange-modal__content {
    background: #0D0D0D;
}
.exchange-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.exchange-modal__header .modal-title {
    margin: 0;
    color: var(--text);
    font-family: 'Lexend', 'Source Sans 3', -apple-system, 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.exchange-modal__subtitle {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.4;
}
.exchange-modal__body {
    padding: 1.5rem;
}
.exchange-modal__widget {
    width: 100%;
}
.exchange-modal__widget--sell {
    min-height: 480px;
}
.exchange-modal__widget--swap {
    min-height: 560px;
}

/* Modal close buttons: clearly visible white X */
.modal .btn-close {
    box-sizing: border-box;
    width: 17px;
    height: 17px;
    padding: 0;
    opacity: 1;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/100% auto no-repeat;
    filter: none;
}

/* Password visibility toggle */
.pw-toggle-wrap {
    position: relative;
    display: block;
}
.pw-toggle-wrap > input {
    padding-right: 3rem;
}
.pw-toggle {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #4682b4;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    z-index: 3;
}
.pw-toggle:hover {
    color: #3A6B96;
}

/* User profile password tab: full-width fields */
#password .form-group,
#password .input--group {
    display: block;
}
#password .form-control {
    width: 100%;
}

/* Create ticket button: compact on mobile */
@media (max-width: 575px) {
    .create-ticket-btn {
        line-height: 40px;
        padding: 0 18px;
        font-size: 14px;
    }
}

/* Primary buttons keep white text on anchor elements */
a.cmn-btn,
a.cmn-btn:link,
a.cmn-btn:visited,
a.cmn-btn:hover,
a.cmn-btn:focus,
a.cmn-btn:active,
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited,
a.btn-primary:hover,
a.btn-primary:focus,
a.btn-primary:active {
    color: #ffffff;
    text-decoration: none;
}

