/* На дне VPN
   Палитра взята из иконки приложения: тёмная морская вода,
   оранжевый осьминог и кремовые буквы с тёмной обводкой.
   Характер — «наклейка»: толстые тёмные контуры и плотные тени без размытия. */

:root {
    /* Вода: из ic_launcher_background */
    --water-center: #153d49;
    --water-mid: #0d2c36;
    --water-edge: #0a262f;
    --ink: #061c24;          /* контуры и тени, как обводка на логотипе */

    /* Осьминог */
    --octo: #c46c22;
    --octo-light: #dd8a3c;
    --octo-dark: #8f4a17;

    /* Буквы логотипа */
    --cream: #e6d09a;
    --cream-soft: #f3e6c4;

    --text: #eadfc6;
    --muted: #9fb4b3;
    --danger: #ff9b85;
    --line: rgba(230, 208, 154, 0.18);
    --panel: rgba(6, 28, 36, 0.55);

    --font-head: "Segoe UI Black", "Arial Black", "Roboto", system-ui, sans-serif;
    --font-body: "Segoe UI", system-ui, -apple-system, "Roboto", sans-serif;

    --step--1: 0.875rem;
    --step-0: 1rem;
    --step-1: 1.25rem;
    --step-2: 1.75rem;
    --step-3: 2.5rem;
    --step-4: clamp(2.5rem, 6.5vw, 4.5rem);

    --radius: 1.1rem;
    --outline: 3px solid var(--ink);
    --shadow: 0 5px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html { background-color: var(--water-edge); }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    /* Тот же радиальный градиент, что на фоне иконки */
    background:
        radial-gradient(ellipse 70% 60% at 50% 38%, var(--water-center) 0%, var(--water-mid) 55%, var(--water-edge) 100%)
        fixed var(--water-edge);
}

h1, h2, h3 {
    font-family: var(--font-head);
    font-weight: 900;
    line-height: 1.08;
    color: var(--cream);
    margin: 0 0 0.6em;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1em; max-width: 68ch; }

a { color: var(--octo-light); text-underline-offset: 0.18em; }
a:hover { color: var(--cream-soft); }

:focus-visible {
    outline: 3px solid var(--cream);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Шапка ---------- */

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
    max-width: 72rem; margin: 0 auto; padding: 1rem 1.5rem;
}

.logo {
    display: inline-flex; align-items: center; gap: 0.7rem;
    font-family: var(--font-head);
    font-size: var(--step-1);
    font-weight: 900;
    color: var(--cream);
    text-decoration: none;
}
.logo img {
    border-radius: 0.7rem;
    border: 2px solid var(--ink);
    box-shadow: 0 3px 0 var(--ink);
}
.logo:hover { color: var(--cream-soft); }

.topnav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.topnav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 600; }
.topnav a:not(.btn):hover { color: var(--octo-light); }

/* ---------- Кнопки: как буквы на логотипе, с контуром и плотной тенью ---------- */

.btn {
    display: inline-block;
    font: 800 var(--step-0)/1 var(--font-body);
    color: var(--ink);
    background: var(--octo);
    border: var(--outline);
    border-radius: 999px;
    box-shadow: var(--shadow);
    padding: 0.8em 1.4em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}
.btn:hover { color: var(--ink); background: var(--octo-light); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }

.btn-ghost { background: var(--cream); }
.btn-ghost:hover { background: var(--cream-soft); }

.btn-small { padding: 0.55em 1em; font-size: var(--step--1); box-shadow: 0 3px 0 var(--ink); }
.btn-small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* ---------- Раскладка ---------- */

.page { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem 4rem; }
.section { margin-top: 4rem; }
.lead { font-size: var(--step-1); color: var(--text); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: var(--step--1); margin: -0.4rem 0 0.8rem; }
.note {
    border-left: 4px solid var(--octo);
    padding-left: 0.9rem;
}

.panel {
    background: var(--panel);
    border: var(--outline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
}

/* ---------- Главная ---------- */

.hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    gap: 2rem;
    padding-top: 3rem;
}

.hero-text h1 {
    font-size: var(--step-4);
    max-width: 13ch;
    color: var(--cream);
    /* Тёмная обводка букв, как на иконке */
    text-shadow:
        -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
        -2px 2px 0 var(--ink), 2px 2px 0 var(--ink),
        0 6px 0 var(--ink);
    margin-bottom: 0.5em;
}

.hero-logo {
    justify-self: center;
    width: min(100%, 22rem);
    height: auto;
    border-radius: 2rem;
    border: 4px solid var(--ink);
    box-shadow: 0 10px 0 var(--ink);
    transform: rotate(3deg);
}

.actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 2rem; }

.reasons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 2.5rem;
}
.reason { border-top: 4px solid var(--octo); padding-top: 1rem; }
.reason p { color: var(--muted); }

.section-split {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
    align-items: start;
}

.facts { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); max-width: 60ch; }
.facts strong { color: var(--cream); font-weight: 700; }

.mini-steps { padding-left: 1.2rem; margin: 0 0 1.5rem; }
.mini-steps li { margin-bottom: 0.4rem; }
.mini-steps li::marker { color: var(--octo-light); font-weight: 800; }

/* ---------- Инструкции: шаги как присоски на щупальце ---------- */

.steps { list-style: none; counter-reset: step; margin: 2rem 0 0; padding: 0; }
.steps li {
    counter-increment: step;
    position: relative;
    padding: 0 0 2rem 4.25rem;
    border-left: 6px solid var(--octo-dark);
    margin-left: 1.25rem;
}
.steps li:last-child { border-left-color: transparent; }
.steps li::before {
    content: counter(step);
    position: absolute; left: -1.55rem; top: -0.3rem;
    width: 2.7rem; height: 2.7rem;
    display: grid; place-items: center;
    font-family: var(--font-head); font-weight: 900;
    color: var(--ink);
    background: var(--cream);
    border: var(--outline);
    border-radius: 50%;
}

.faq details { border-bottom: 1px solid var(--line); padding: 0.9rem 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--cream); }
.faq summary::marker { color: var(--octo-light); }
.faq details p { margin-top: 0.6rem; color: var(--muted); }

/* ---------- Формы ---------- */

.auth {
    max-width: 27rem;
    margin: 3.5rem auto 0;
    background: var(--panel);
    border: var(--outline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.form { display: flex; flex-direction: column; margin: 1.5rem 0; }
.form label { font-weight: 700; margin-bottom: 0.35rem; }
.form input, .form textarea, .copy-field {
    font: inherit;
    color: var(--text);
    background: rgba(6, 28, 36, 0.75);
    border: 2px solid var(--ink);
    border-radius: 0.7rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
    width: 100%;
}
.form input:focus, .form textarea:focus, .copy-field:focus {
    border-color: var(--octo);
    outline: none;
    box-shadow: 0 0 0 3px rgba(196, 108, 34, 0.35);
}
.form textarea { resize: vertical; }
.form .btn { align-self: flex-start; }
.form h3 { margin-bottom: 1rem; }

.copy-field { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--step--1); }

.alert {
    color: var(--danger);
    background: rgba(255, 155, 133, 0.08);
    border: 2px solid rgba(255, 155, 133, 0.45);
    border-radius: 0.7rem;
    padding: 0.7rem 0.9rem;
}

/* ---------- Кабинет и тикеты ---------- */

.cabinet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.cabinet-head .muted { margin: 0; }

.ticket-list { list-style: none; padding: 0; margin: 1rem 0 2rem; }
.ticket-list li {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1rem;
    padding: 0.9rem 0; border-bottom: 1px solid var(--line);
}
.ticket-list li a { font-weight: 700; }
.ticket-list .is-waiting a { color: var(--cream); }

.badge {
    font-size: var(--step--1);
    font-weight: 700;
    color: var(--ink);
    background: var(--octo);
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: 0 0.7em;
}

/* ---------- Чат ---------- */

.chat-page { max-width: 46rem; }

.messages {
    display: flex; flex-direction: column; gap: 0.8rem;
    max-height: 60vh; overflow-y: auto;
    padding: 1rem;
    background: var(--panel);
    border: var(--outline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.msg {
    max-width: 80%;
    padding: 0.7rem 0.95rem;
    border: 2px solid var(--ink);
    border-radius: 1rem;
}
.msg-mine {
    align-self: flex-end;
    background: var(--octo);
    color: var(--ink);
    border-bottom-right-radius: 0.3rem;
}
.msg-mine .msg-meta { color: rgba(6, 28, 36, 0.75); }
.msg-other {
    align-self: flex-start;
    background: var(--cream);
    color: var(--ink);
    border-bottom-left-radius: 0.3rem;
}
.msg-other .msg-meta { color: rgba(6, 28, 36, 0.65); }
.msg-meta { display: flex; gap: 0.75rem; font-size: var(--step--1); font-weight: 700; margin-bottom: 0.15rem; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.chat-form { margin-top: 1.5rem; }

/* ---------- Подвал ---------- */

.footer {
    max-width: 72rem; margin: 0 auto; padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted); font-size: var(--step--1);
}
.footer p { margin: 0.2rem 0; }

/* ---------- Телефоны ---------- */

@media (max-width: 760px) {
    .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
    .hero-logo { grid-row: 1; width: 11rem; }
    .section-split { grid-template-columns: 1fr; }
    .section { margin-top: 3rem; }
    .msg { max-width: 92%; }
    .cabinet-head { flex-direction: column; }
    .logo span { font-size: var(--step-0); }
    .auth { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .btn { transition: none; }
    .hero-logo { transform: none; }
}

/* ---------- Telegram в подвале ---------- */

.tg-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }

.tg {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--cream);
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: 0 3px 0 var(--ink);
    padding: 0.5em 1em;
    text-decoration: none;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}
.tg:hover { color: var(--ink); background: var(--cream-soft); }
.tg:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.tg-icon { flex: none; }

/* ---------- Подтверждение почты ---------- */

.code-input {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: var(--step-2);
    letter-spacing: 0.5em;
    text-align: center;
}

.notice {
    color: var(--cream);
    background: rgba(230, 208, 154, 0.1);
    border: 2px solid var(--line);
    border-radius: 0.7rem;
    padding: 0.7rem 0.9rem;
}

.auth-actions { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1rem; }

.link-button {
    font: inherit;
    color: var(--octo-light);
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
}
.link-button:hover { color: var(--cream-soft); }

/* ---------- Админка ---------- */

.admin-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.admin-head h1 { margin-bottom: 0.2em; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.admin-table th {
    text-align: left;
    font-family: var(--font-head);
    color: var(--cream);
    border-bottom: 3px solid var(--ink);
    padding: 0.6rem 0.75rem;
}
.admin-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); }
.admin-table tr.is-waiting { background: rgba(196, 108, 34, 0.12); }
.admin-table tr.is-waiting a { color: var(--cream); }
.admin-table a { font-weight: 700; }

.dot { color: var(--octo-light); }

.badge-warn { background: var(--danger); }

.admin-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.3rem 1.25rem;
    margin: 0 0 1.5rem;
}
.admin-meta dt { color: var(--muted); }
.admin-meta dd { margin: 0; }

.danger-zone {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px dashed var(--line);
}

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #ffb3a0; }

@media (max-width: 720px) {
    /* Таблица не помещается — показываем карточками */
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
    .admin-table thead { display: none; }
    .admin-table tr { border: 2px solid var(--ink); border-radius: var(--radius); margin-bottom: 1rem; padding: 0.5rem; }
    .admin-table td { border: none; padding: 0.25rem 0.5rem; }
    .admin-meta { grid-template-columns: 1fr; }
    .admin-meta dt { margin-top: 0.5rem; }
}
/* ---------- Выбор языка ---------- */

.lang { position: relative; }

/* Кнопка. Повторяет .btn-small .btn-ghost, но со своими отступами под иконки. */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font: 800 var(--step--1)/1 var(--font-body);
    color: var(--ink);
    background: var(--cream);
    border: var(--outline);
    border-radius: 999px;
    box-shadow: 0 3px 0 var(--ink);
    padding: 0.55em 0.9em;
    cursor: pointer;
    user-select: none;
    list-style: none;          /* убираем стандартный треугольник */
    transition: background-color 0.15s ease;
}
.lang-toggle::-webkit-details-marker { display: none; }
.lang-toggle::marker { content: ""; }
.lang-toggle::-webkit-details-marker { display: none; }

.lang-toggle:hover { background: var(--cream-soft); }

.lang-caret { transition: transform 0.15s ease; }
.lang[open] .lang-caret { transform: rotate(180deg); }

/* Список */
.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    z-index: 30;
    min-width: 11rem;
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    background: var(--water-mid);
    border: var(--outline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: lang-in 0.12s ease-out;
}

@keyframes lang-in {
    from { opacity: 0; transform: translateY(-0.4rem); }
    to   { opacity: 1; transform: none; }
}

.lang-menu a {
    display: grid;
    grid-template-columns: 2rem 1fr 1rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.7rem;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}
.lang-menu a:hover { color: var(--ink); background: var(--cream); }

.lang-code {
    font-family: var(--font-head);
    font-size: var(--step--1);
    font-weight: 900;
    color: var(--octo-light);
}
.lang-menu a:hover .lang-code { color: var(--octo-dark); }

.lang-check { visibility: hidden; font-weight: 900; }
.lang-menu a.is-active .lang-check { visibility: visible; }
.lang-menu a.is-active { color: var(--cream); }

@media (max-width: 760px) {
    .lang-menu { right: auto; left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lang-menu { animation: none; }
    .lang-caret { transition: none; }
}

/* ---------- Тарифы ---------- */

.plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.plan {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
    padding: 1.5rem 1.25rem;
}
.plan h3 { margin: 0; }
.plan .btn { margin-top: auto; align-self: center; }

.plan-price {
    font-family: var(--font-head);
    font-size: var(--step-2);
    font-weight: 900;
    color: var(--cream);
    margin: 0;
}

.plans-note {
    color: var(--muted);
    font-size: var(--step--1);
    margin-top: 1.5rem;
}
/* ---------- Подвал ---------- */

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
}
.footer-links a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}
.footer-links a:hover {
    color: var(--cream-soft);
    border-bottom-color: var(--octo);
}

.footer-support { margin: 0; }