/* Базовый стиль веб-кабинета. */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
    background: #f5f6fa;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #2962ff;
    text-decoration: none;
}
a:hover { text-decoration: underline; }

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e1e4e8;
    padding: 16px 0;
}
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: #2962ff;
    text-decoration: none;
}
.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}
.inline-form { display: inline; }
.link-button {
    background: none;
    border: none;
    color: #2962ff;
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.link-button:hover { text-decoration: underline; }

main {
    flex: 1;
    padding: 40px 20px;
}

/* Hero (главная) */
.hero h1 {
    font-size: 36px;
    margin-bottom: 20px;
}
.hero .lead {
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
}
.hero .note {
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
}

/* Auth cards (login/register/...) */
.auth-card {
    max-width: 400px;
    margin: 40px auto;
    padding: 32px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e4e8;
}
.auth-card h1 {
    font-size: 24px;
    margin-bottom: 20px;
}
.auth-card label {
    display: block;
    margin-bottom: 16px;
    color: #444;
    font-size: 14px;
}
.auth-card input {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 15px;
}
.auth-card input:focus {
    outline: none;
    border-color: #2962ff;
}
.auth-footer {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 10px 16px;
    background: #2962ff;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary:hover { background: #1e4fd6; text-decoration: none; }
.btn-block { display: block; width: 100%; margin-top: 8px; }

/* Alerts */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
    border-radius: 6px;
    font-size: 14px;
}

/* Dashboard */
.dashboard h1 { font-size: 28px; margin-bottom: 4px; }
.muted { color: #888; }
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.card {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e4e8;
}
.card h3 { font-size: 14px; color: #666; margin-bottom: 8px; font-weight: 500; }
.card .big { font-size: 24px; font-weight: 600; }
.card.section { margin: 24px 0; }
.card.section p { margin: 12px 0; }
.card.section code {
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
}
.link-code {
    font-size: 40px !important;
    font-weight: 700;
    letter-spacing: 4px;
    text-align: center;
    padding: 16px;
    background: #f5f6fa;
    border-radius: 8px;
    margin: 16px 0 !important;
}
.small { font-size: 13px; }

/* Action row (кнопки под карточками) */
.action-row {
    margin: 24px 0;
}

/* Buy page (тарифы) */
.buy-page h1 { margin-bottom: 8px; }
.buy-page .muted { margin-bottom: 24px; }

.device-group-title {
    margin: 24px 0 12px;
    font-size: 18px;
    color: #444;
}

.tariff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.tariff-card {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e4e8;
    text-align: center;
    transition: border-color 0.15s, transform 0.15s;
}
.tariff-card:hover {
    border-color: #2962ff;
    transform: translateY(-2px);
}

.tariff-period {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.tariff-price {
    font-size: 28px;
    font-weight: 700;
    color: #2962ff;
    margin-bottom: 8px;
}

.tariff-name {
    margin-bottom: 12px;
    min-height: 18px;
}

.tariff-card form { margin-top: 12px; }

/* Server grid */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.server-card-form { margin: 0; display: block; }
.server-card {
    width: 100%;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e4e8;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    font-family: inherit;
}
.server-card:hover {
    border-color: #2962ff;
    transform: translateY(-2px);
}
.server-card-current {
    border-color: #2962ff;
    background: #f5f9ff;
}
.server-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* VPN key block */
.vpn-key-block {
    margin: 16px 0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.vpn-key-text {
    flex: 1;
    min-width: 240px;
    padding: 12px;
    background: #f5f6fa;
    border-radius: 8px;
    overflow: hidden;
}
.vpn-key-text code {
    display: block;
    word-break: break-all;
    font-size: 12px;
    margin-bottom: 8px;
    background: transparent !important;
    padding: 0 !important;
}
.copy-btn {
    font-size: 14px;
}
.vpn-qr {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e1e4e8;
    padding: 6px;
}

/* Buy page */
.buy-page h1 { font-size: 28px; margin-bottom: 12px; }
.device-group-title {
    font-size: 18px;
    margin-top: 32px;
    margin-bottom: 12px;
    color: #444;
}
.tariff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.tariff-card {
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    text-align: center;
}
.tariff-card:hover {
    border-color: #2962ff;
    transform: translateY(-2px);
    transition: all 0.15s ease;
}
.tariff-period {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}
.tariff-price {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}
.tariff-name { margin-bottom: 12px; }

.action-row {
    margin: 24px 0;
}

/* Footer */
.site-footer {
    background: #fff;
    border-top: 1px solid #e1e4e8;
    padding: 20px 0;
    color: #888;
    font-size: 14px;
    text-align: center;
}
