:root {
    --bg-main: #0c1119;
    --bg-secondary: #111826;
    --surface: rgba(20, 28, 41, 0.92);
    --surface-light: rgba(28, 38, 56, 0.96);
    --surface-hover: rgba(39, 51, 73, 0.98);
    --primary: #7c9cff;
    --primary-strong: #5b7df0;
    --primary-soft: rgba(124, 156, 255, 0.14);
    --secondary: #65e4c7;
    --accent-error: #ff6b81;
    --accent-warning: #ffb454;
    --text-main: #f4f7fb;
    --text-secondary: #9aa8bf;
    --text-muted: #70809b;
    --border: rgba(124, 156, 255, 0.18);
    --border-strong: rgba(124, 156, 255, 0.32);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-full: 999px;
    --shadow-soft: 0 16px 40px rgba(5, 10, 20, 0.45);
    --shadow-primary: 0 12px 30px rgba(91, 125, 240, 0.25);
    --transition-base: 220ms ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(101, 228, 199, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(124, 156, 255, 0.14), transparent 32%),
        linear-gradient(180deg, #0b111a 0%, #0d1521 45%, #0a1018 100%);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.bg-blob {
    position: fixed;
    inset: auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.22;
    pointer-events: none;
    z-index: -1;
    animation: floatBlob 14s ease-in-out infinite;
}

.blob-1 {
    top: -60px;
    left: -80px;
    background: rgba(124, 156, 255, 0.25);
}

.blob-2 {
    right: -80px;
    bottom: 10%;
    background: rgba(101, 228, 199, 0.16);
    animation-delay: -5s;
}

.blob-3 {
    right: 20%;
    top: 18%;
    background: rgba(255, 180, 84, 0.1);
    width: 240px;
    height: 240px;
    animation-delay: -9s;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background: rgba(12, 17, 25, 0.86);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

.logo i {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-item,
.nav-balance {
    min-height: 42px;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: var(--transition-base);
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    box-shadow: var(--shadow-primary);
}

.nav-balance {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--secondary);
    font-weight: 700;
}

.main-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: clamp(2rem, 4.8vw, 3.6rem);
    line-height: 1.08;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: -0.04em;
}

.page-subtitle {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 1.8vw, 1.08rem);
}

.card,
.content-card,
.auth-box {
    background: linear-gradient(180deg, rgba(20, 28, 41, 0.96), rgba(16, 23, 34, 0.96));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.content-card,
.auth-box,
.card {
    padding: 24px;
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-box {
    width: 100%;
    max-width: 460px;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.form-input,
.form-select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    padding: 14px 16px;
    outline: none;
    transition: var(--transition-base);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-base);
    font-weight: 700;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
}

.btn-small {
    padding: 10px 14px;
    font-size: 0.85rem;
}

.filters-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.filter-group {
    min-width: 0;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px 18px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    vertical-align: top;
}

tbody tr:hover td {
    background: rgba(124, 156, 255, 0.04);
}

code {
    color: var(--secondary);
    font-family: Consolas, monospace;
}

.cell-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.price-cell {
    font-weight: 800;
    white-space: nowrap;
}

.empty-cell {
    text-align: center;
    padding: 52px 20px;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-gold {
    color: #ffd47c;
    background: rgba(255, 180, 84, 0.12);
    border: 1px solid rgba(255, 180, 84, 0.22);
}

.badge-diamond {
    color: #8bd3ff;
    background: rgba(124, 156, 255, 0.14);
    border: 1px solid rgba(124, 156, 255, 0.24);
}

.badge-standard {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-positive,
.status-negative {
    font-size: 0.84rem;
    font-weight: 700;
}

.status-positive {
    color: var(--secondary);
}

.status-negative {
    color: var(--accent-error);
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-weight: 600;
}

.alert-error {
    background: rgba(255, 107, 129, 0.12);
    border: 1px solid rgba(255, 107, 129, 0.22);
    color: #ffc6d0;
}

.alert-success {
    background: rgba(101, 228, 199, 0.12);
    border: 1px solid rgba(101, 228, 199, 0.22);
    color: #c7fff2;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 28px;
}

.step {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 800;
}

.step.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    border-color: transparent;
    color: #fff;
}

.step.completed {
    background: rgba(101, 228, 199, 0.16);
    border-color: rgba(101, 228, 199, 0.24);
    color: var(--secondary);
}

.crypto-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.crypto-option {
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
}

.crypto-option:hover,
.crypto-option.selected {
    border-color: var(--border-strong);
    background: var(--primary-soft);
    transform: translateY(-2px);
}

.crypto-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.crypto-name {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
}

.crypto-min {
    display: block;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.wallet-display {
    display: none;
    margin: 18px 0 22px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
}

.wallet-address {
    margin: 10px 0 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(9, 14, 22, 0.9);
    border: 1px dashed var(--border);
    color: var(--secondary);
    word-break: break-all;
    font-family: Consolas, monospace;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 700;
}

.order-status-card {
    display: none;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--radius-full);
    font-weight: 700;
    margin: 12px 0 18px;
}

.status-pending {
    background: rgba(255, 180, 84, 0.12);
    border: 1px solid rgba(255, 180, 84, 0.2);
    color: #ffd29c;
}

.status-completed {
    background: rgba(101, 228, 199, 0.14);
    border: 1px solid rgba(101, 228, 199, 0.24);
    color: #d2fff6;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 74px;
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    font-size: 1.6rem;
    box-shadow: var(--shadow-primary);
}

.profile-info p {
    color: var(--text-secondary);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.vault-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.vault-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.vault-card h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.vault-date,
.vault-details,
.vault-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.vault-card-number {
    font-family: Consolas, monospace;
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(7, 12, 20, 0.8);
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.vault-meta,
.vault-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vault-details {
    margin-top: 10px;
}

.empty-state {
    padding: 52px 20px;
    text-align: center;
    color: var(--text-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
}

.empty-state i {
    display: block;
    margin-bottom: 14px;
    font-size: 2rem;
    color: var(--text-muted);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 8, 14, 0.72);
    backdrop-filter: blur(8px);
    z-index: 60;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, #152033, #101827);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.modal-card h3 {
    margin-bottom: 10px;
}

.modal-card p {
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

#toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(16, 23, 34, 0.96);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    pointer-events: auto;
    animation: toastIn 200ms ease;
}

.toast i {
    font-size: 1rem;
}

.toast-success {
    border-color: rgba(101, 228, 199, 0.25);
}

.toast-success i {
    color: var(--secondary);
}

.toast-error {
    border-color: rgba(255, 107, 129, 0.25);
}

.toast-error i {
    color: var(--accent-error);
}

.toast-info i {
    color: var(--primary);
}

.toast-exit {
    animation: toastOut 260ms ease forwards;
}

.animate-fade-in {
    animation: fadeIn 240ms ease;
}

.animate-slide-up {
    animation: slideUp 320ms ease;
}

@keyframes floatBlob {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(18px, -12px, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

@media (max-width: 1080px) {
    .filters-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tbody {
        padding: 10px;
    }

    tr {
        margin-bottom: 14px;
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        overflow: hidden;
        background: rgba(255, 255, 255, 0.03);
    }

    td {
        position: relative;
        padding: 14px 16px 14px 44%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        min-height: 54px;
    }

    td:last-child {
        border-bottom: none;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 16px;
        top: 14px;
        width: 36%;
        color: var(--text-secondary);
        font-size: 0.74rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    td .btn {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links {
        justify-content: stretch;
        width: 100%;
    }

    .nav-item,
    .nav-balance {
        flex: 1 1 calc(50% - 10px);
    }

    .filters-bar,
    .crypto-options {
        grid-template-columns: 1fr;
    }

    .main-container {
        padding-inline: 14px;
    }

    .content-card,
    .card,
    .auth-box {
        padding: 18px;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .vault-meta,
    .vault-details,
    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (min-width: 640px) {
    #toast-container {
        left: auto;
        width: 360px;
    }
}
