@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
    --bg: #0d1119;
    --bg-soft: #121827;
    --panel: #171f30;
    --panel-soft: #1b2438;
    --text: #ebf0ff;
    --text-muted: #9aa6c2;
    --accent: #5ec7ff;
    --accent-strong: #3ab7fa;
    --danger: #ff6f7a;
    --ok: #5fd19b;
    --border: rgba(255, 255, 255, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    background: radial-gradient(1000px 500px at -10% -30%, rgba(94, 199, 255, 0.14), transparent 65%), linear-gradient(180deg, var(--bg) 0%, #0a0f19 100%);
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 16px 24px;
}

body > .container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(13, 17, 25, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.navbar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.icon-badge {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(94, 199, 255, 0.14);
}

.navbar-collapse {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    text-decoration: none;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.93rem;
    line-height: 1.1;
}

.nav-link:hover {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.icon,
.icon-svg {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    opacity: 0.95;
    filter: none;
}

.profile-menu {
    position: relative;
}

.profile-toggle {
    background: transparent;
}

.profile-toggle .icon-caret {
    width: 14px;
    height: 14px;
    margin-left: 2px;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(13, 17, 25, 0.98);
    box-shadow: var(--shadow);
    z-index: 30;
}

.profile-menu.open .profile-dropdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropdown-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.92rem;
}

.dropdown-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.navbar-toggler {
    display: none;
    margin-left: auto;
    width: 38px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    padding: 6px;
}

.navbar-toggler-icon {
    display: block;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
        to bottom,
        var(--text) 0%,
        var(--text) 16%,
        transparent 16%,
        transparent 42%,
        var(--text) 42%,
        var(--text) 58%,
        transparent 58%,
        transparent 84%,
        var(--text) 84%,
        var(--text) 100%
    );
}

a {
    color: var(--accent);
    text-decoration: none;
}

.card {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-soft) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    margin: 14px 0;
}

.auth-card {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.card h1, .card h2, .card h3 {
    margin: 0 0 10px;
    line-height: 1.25;
}

.card p {
    margin: 0 0 10px;
}

.home-hero {
    display: grid;
    gap: 18px;
    align-items: center;
}

.home-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-hero-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
    font-size: 1rem;
}

.home-hero-points li {
    margin: 0;
}

.home-hero-cta {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text);
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.plans > * {
    min-width: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--accent-strong);
    color: #04131a;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 14px rgba(58, 183, 250, 0.2);
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.03);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-color: var(--border);
    box-shadow: none;
}

.btn.danger {
    background: rgba(255, 111, 122, 0.18);
    color: #ffe8eb;
    border-color: rgba(255, 111, 122, 0.45);
    box-shadow: none;
}

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

.promo {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
}

.promo-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.promo-input[hidden] {
    display: none;
}

.promo-input input {
    margin: 0;
}

.flash {
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 10px 12px;
    margin-top: 10px;
}

.flash.error {
    background: rgba(255, 111, 122, 0.12);
    border-color: rgba(255, 111, 122, 0.35);
    color: #ffd8dc;
}

.flash.success {
    background: rgba(95, 209, 155, 0.12);
    border-color: rgba(95, 209, 155, 0.35);
    color: #dcffe9;
}

input,
select,
textarea {
    width: 100%;
    margin: 6px 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 10px;
    background: rgba(12, 17, 27, 0.84);
    color: var(--text);
    font-family: "Manrope", sans-serif;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin: 0;
    padding: 0;
    accent-color: var(--accent-strong);
}

.input-with-action {
    position: relative;
}

.input-with-action-field {
    padding-right: 42px;
}

.input-action-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(calc(-50% - 2px));
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.input-action-btn:hover {
    background: rgba(255, 255, 255, 0.09);
}

textarea {
    resize: vertical;
}

code {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(7, 11, 18, 0.9);
    color: #d5ecff;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 0.84rem;
}

.copyable-code {
    position: relative;
    cursor: copy;
    user-select: all;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.copyable-code:hover {
    border-color: rgba(94, 199, 255, 0.55);
    background: rgba(9, 20, 36, 0.95);
}

.copyable-code::after {
    content: attr(data-copy-label);
    position: absolute;
    top: 8px;
    right: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(94, 199, 255, 0.4);
    background: rgba(9, 20, 36, 0.9);
    color: #8bd6ff;
    font-size: 0.7rem;
    font-family: "Manrope", "Segoe UI", sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.copyable-code:hover::after,
.copyable-code[data-copy-active="1"]::after {
    opacity: 1;
}

.muted {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.divider {
    margin: 10px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.telegram-login {
    display: flex;
    justify-content: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-terms {
    margin: 0 0 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-terms-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    color: var(--text);
}

.auth-terms-text {
    display: inline-block;
    white-space: nowrap;
}

.auth-terms-error {
    margin: 6px 0 0;
    color: #ff9ea6;
    font-size: 0.86rem;
}

table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

th, td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    padding: 8px 6px;
    vertical-align: top;
    font-size: 0.92rem;
}

.table-wrap {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

.dashboard-table {
    min-width: 0;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
}

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

.site-footer {
    margin: auto 0 8px;
    padding: 12px 0 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--text-muted);
}

.site-footer a:hover {
    color: var(--text);
}

.legal-card h2 {
    margin-top: 14px;
    margin-bottom: 8px;
    font-size: 1.02rem;
}

.legal-card ul {
    list-style: disc;
    margin: 0 0 12px 20px;
    padding: 0;
}

.legal-card li {
    border-bottom: none;
    padding: 3px 0;
}

.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 10, 18, 0.62);
    backdrop-filter: blur(4px);
}

.confirm-modal-backdrop.show {
    display: flex;
}

.confirm-modal {
    width: min(460px, 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-soft) 100%);
    box-shadow: var(--shadow);
    padding: 16px;
    animation: modal-pop 0.14s ease-out;
}

.confirm-modal h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.confirm-modal-message {
    margin: 0;
    color: var(--text-muted);
}

.confirm-modal-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.confirm-modal-actions .btn {
    margin-top: 0;
}

body.modal-open {
    overflow: hidden;
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 720px) {
    .navbar-toggler {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .navbar-collapse {
        display: none;
        position: absolute;
        right: 16px;
        top: calc(100% + 8px);
        width: min(250px, calc(100vw - 32px));
        margin-left: 0;
        padding: 10px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: rgba(13, 17, 25, 0.98);
        box-shadow: var(--shadow);
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .navbar-collapse.show {
        display: flex;
    }

    .nav-link {
        padding: 8px 10px;
    }

    .profile-menu {
        width: 100%;
    }

    .profile-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .profile-dropdown {
        position: static;
        display: none;
        min-width: 0;
        border-radius: 10px;
        margin-top: 6px;
        box-shadow: none;
    }

    .profile-menu.open .profile-dropdown {
        display: flex;
    }

    .plans {
        grid-template-columns: 1fr;
    }

    .home-hero-actions {
        flex-direction: column;
    }

    .btn,
    .btn.secondary {
        width: 100%;
    }

    .promo-input {
        flex-direction: column;
        align-items: stretch;
    }
}
