
:root {
    color-scheme: dark;
    --bg: #080e16;
    --panel: #111b28;
    --panel-light: #172535;
    --border: #26384a;
    --text: #f4f7fb;
    --muted: #91a3b8;
    --green: #35d68b;
    --green-dark: #102e23;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at top, #142b2a 0%, transparent 45%),
        var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

button {
    -webkit-appearance: none;
    appearance: none;
}

button:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 3px;
}

.app {
    width: min(100%, 540px);
    margin: 0 auto;
    padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
}

.header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.logo {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border: 1px solid #4ce6a1;
    border-radius: 16px;
    background: linear-gradient(145deg, #49e8a0, #20ad70);
    color: #062016;
    font-size: 26px;
    font-weight: 800;
    box-shadow: 0 6px 24px #35d68b24;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 4px;
    font-size: 20px;
    letter-spacing: -0.4px;
}

.header p,
.muted,
small {
    color: var(--muted);
}

.header p {
    margin-bottom: 0;
    font-size: 13px;
}

.status {
    margin-left: auto;
    white-space: nowrap;
    color: var(--green);
    font-size: 12px;
}

.subscription,
.card {
    margin-bottom: 16px;
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: 0 12px 32px #00000012;
}

.subscription {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 100% 0%, #35d68b20, transparent 55%),
        linear-gradient(145deg, #172c32, #111b28 75%);
}

.eyebrow {
    margin-bottom: 12px;
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
}

.subscription h2 {
    margin-bottom: 20px;
    font-size: clamp(22px, 6vw, 27px);
    letter-spacing: -0.7px;
}

.subscription .muted {
    margin-bottom: 8px;
    font-size: 13px;
}

.subscription h3 {
    margin: 0 0 20px;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.progress {
    height: 7px;
    overflow: hidden;
    border-radius: 10px;
    background: #2a3b49;
}

.progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #24b978, var(--green));
    transition: width 0.3s ease;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 22px;
}

.stats div {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
}

.stats .muted {
    margin: 0;
    font-size: 12px;
}

.stats strong {
    font-size: 15px;
    overflow-wrap: anywhere;
}

.primary,
.action,
.client,
.device-button {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 15px;
    font: inherit;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.primary {
    display: block;
    margin-bottom: 22px;
    background: linear-gradient(135deg, #43e59b, #27c982);
    color: #062016;
    font-weight: 700;
    box-shadow: 0 8px 24px #28c98220;
}

.primary:hover {
    background: #55e7a5;
}

.primary:active,
.action:active,
.client:active,
.device-button:active {
    transform: scale(0.985);
}

.card h2 {
    margin-bottom: 10px;
    font-size: 18px;
    letter-spacing: -0.3px;
}

.card > .muted {
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.5;
}

.clients {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 17px;
}

.client {
    display: grid;
    justify-items: start;
    align-content: start;
    gap: 9px;
    min-width: 0;
    min-height: 130px;
    border-color: var(--border);
    background: linear-gradient(145deg, #162332, #101925);
    text-align: left;
}

.client span {
    font-size: 25px;
}

.client strong {
    font-size: 15px;
}

.client small {
    font-size: 11px;
    line-height: 1.4;
}

.client:focus,
.client:hover,
.client:focus-visible {
    border-color: var(--green);
    background: var(--green-dark);
}

.message {
    margin: 15px 0 0;
    padding: 12px 13px;
    border: 1px solid #26384a;
    border-radius: 12px;
    background: #0c1520;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.action {
    display: block;
    margin-top: 10px;
    border-color: var(--border);
    background: var(--panel-light);
    color: var(--text);
    text-align: left;
}

.action:hover {
    border-color: var(--green);
    background: #1b302d;
}

footer {
    padding: 20px 0 8px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.device-selector {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #0c1520;
}

.device-selector h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.device-selector .muted {
    font-size: 13px;
    line-height: 1.5;
}

.device-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.device-button {
    min-width: 0;
    padding: 13px 10px;
    border-color: var(--border);
    background: var(--panel-light);
    color: var(--text);
    font-size: 13px;
}

.device-button:hover {
    border-color: var(--green);
}

[hidden] {
    display: none !important;
}

@media (max-width: 360px) {
    .app {
        padding-right: 12px;
        padding-left: 12px;
    }

    .subscription,
    .card {
        padding: 17px;
        border-radius: 18px;
    }

    .status {
        font-size: 10px;
    }

    .client {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Результат VPN-подключения */
.config-result {
    margin-top: 24px;
    padding: 20px;
    background: #171923;
    border: 1px solid #303445;
    border-radius: 18px;
    text-align: center;
}

.config-result h3 {
    margin: 0 0 18px;
    color: #ffffff;
    font-size: 20px;
}

.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0 22px;
    min-height: 220px;
}

.qr-container img {
    display: block;
    max-width: 100%;
    height: auto;
    padding: 10px;
    background: #ffffff;
    border-radius: 12px;
}

.config-result textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 10px 0 14px;
    padding: 12px;
    color: #ffffff;
    background: #10121a;
    border: 1px solid #303445;
    border-radius: 10px;
    resize: vertical;
    overflow-wrap: anywhere;
}

.config-result .primary {
    width: 100%;
}

[hidden] {
    display: none !important;
}

/* Выбранный VPN-клиент */
.client.selected {
    border-color: #35d07f;
    background: rgba(53, 208, 127, 0.12);
    box-shadow: 0 0 0 1px #35d07f;
}

.client {
    transition: border-color 0.2s ease, background 0.2s ease;
}

/* Выбранная операционная система */
.device-button.selected {
    border-color: #35d07f;
    background: rgba(53, 208, 127, 0.12);
    box-shadow: 0 0 0 1px #35d07f;
}

.device-button {
    transition: border-color 0.2s ease, background 0.2s ease;
}