/* ==== FreedomKvn Web — тёмный дизайн ==== */

:root {
    --bg: #0b1220;
    --bg-alt: #121b2e;
    --bg-card: #16223a;
    --border: #24304a;
    --border-hi: #2e3d5c;
    --text: #e6ecf5;
    --text-mut: #93a1bd;
    --accent: #4f8cff;
    --accent-hi: #6ea1ff;
    --accent-dim: #2b5dbf;
    --success: #2ecc71;
    --warning: #f5a524;
    --danger: #ef4444;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(1200px 800px at 50% -10%, #1a2742 0%, var(--bg) 55%) fixed;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--accent-hi);
    text-decoration: none;
    transition: color .15s;
}
a:hover { color: #9bbdff; }

/* ==== Контейнер ==== */

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==== Шапка ==== */

.topbar {
    background: rgba(11, 18, 32, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #8a5cff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 0 20px rgba(79, 140, 255, 0.4);
}

.topbar-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.topbar-nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-mut);
    font-weight: 500;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.topbar-nav a:hover {
    background: var(--bg-card);
    color: var(--text);
}

/* ==== Основной блок ==== */

main {
    padding: 20px 0 30px;
}

/* ==== Карточки ==== */

.card {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-alt));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card-tight { padding: 16px; }

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text);
}

.card-sub {
    color: var(--text-mut);
    margin: 0 0 18px;
    font-size: 14px;
}

/* ==== Заголовки ==== */

h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
}

.hero-sub {
    color: var(--text-mut);
    font-size: 16px;
    margin: 0 0 30px;
    max-width: 560px;
}

/* ==== Кнопки ==== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .08s, background .15s, box-shadow .15s;
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #fff;
    box-shadow: 0 6px 20px rgba(79, 140, 255, 0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hi), var(--accent));
    color: #fff;
    box-shadow: 0 8px 26px rgba(79, 140, 255, 0.5);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border-hi);
    color: var(--text);
}
.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #1f9e59);
    color: #fff;
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #a82626);
    color: #fff;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-lg {
    padding: 14px 26px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==== Формы ==== */

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text);
}

.form-control,
.form-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.2);
}

.form-control::placeholder {
    color: #5b6a89;
}

.form-control-lg {
    padding: 15px 18px;
    font-size: 17px;
}

.form-select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2393a1bd' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-help {
    font-size: 13px;
    color: var(--text-mut);
    margin-top: 6px;
}

/* ==== Алерты ==== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.4);
    color: #86efac;
}

.alert-warning {
    background: rgba(245, 165, 36, 0.1);
    border-color: rgba(245, 165, 36, 0.4);
    color: #fcd34d;
}

.alert-info {
    background: rgba(79, 140, 255, 0.1);
    border-color: rgba(79, 140, 255, 0.4);
    color: #93b8ff;
}

/* ==== Список инфо ==== */

.info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 20px;
}
.info-row:last-child { border-bottom: none; }

.info-label {
    color: var(--text-mut);
    font-size: 14px;
}

.info-value {
    font-weight: 600;
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

/* ==== Статус бейдж ==== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
}

.badge-active {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.badge-pending {
    background: rgba(245, 165, 36, 0.15);
    color: #fcd34d;
}

.badge-info {
    background: rgba(79, 140, 255, 0.15);
    color: #93b8ff;
}

/* ==== Hero ==== */

.hero {
    text-align: center;
    padding: 16px 0 12px;
}

.hero h1 {
    font-size: 30px;
    margin-bottom: 8px;
}

.hero p {
    font-size: 15px;
    color: var(--text-mut);
    max-width: 520px;
    margin: 0 auto 18px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==== Фичи ==== */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-align: center;
}

.feature-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.feature-text {
    color: var(--text-mut);
    font-size: 12px;
    line-height: 1.4;
}

/* ==== HAPP-ссылка ==== */

.link-box {
    background: var(--bg);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-family: 'SF Mono', Consolas, Monaco, monospace;
    font-size: 12px;
    color: var(--text);
    word-break: break-all;
    margin: 12px 0;
    -webkit-user-select: all;
    user-select: all;
}

/* ==== Устройства ==== */

.device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    gap: 14px;
}

.device-info {
    flex: 1;
    min-width: 0;
}

.device-name {
    font-weight: 600;
    margin-bottom: 3px;
    word-break: break-word;
}

.device-meta {
    color: var(--text-mut);
    font-size: 12px;
}

/* ==== Footer ==== */

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-mut);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

footer a { color: var(--text-mut); }
footer a:hover { color: var(--accent-hi); }

/* ==== Утилиты ==== */

.text-center { text-align: center; }
.text-mut { color: var(--text-mut); }
.text-mut-sm { color: var(--text-mut); font-size: 13px; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 20px; }
.mono { font-family: 'SF Mono', Consolas, Monaco, monospace; }

/* ==== Мобильная адаптация ==== */

@media (max-width: 640px) {
    .hero h1 { font-size: 26px; }
    .hero p { font-size: 14px; }
    h1 { font-size: 22px; }
    .card { padding: 18px 16px; }
    .topbar-nav { gap: 4px; }
    .topbar-nav a { padding: 6px 10px; font-size: 13px; }
    main { padding: 16px 0 24px; }
    .brand { font-size: 15px; }
    .brand-logo { width: 28px; height: 28px; font-size: 15px; }
    .btn-row { flex-direction: column; }
    .btn-row .btn { width: 100%; }
    .info-value { max-width: 55%; font-size: 13px; }
    .features { gap: 8px; grid-template-columns: repeat(2, 1fr); }
    .feature { padding: 10px 12px; }
    .feature-title { font-size: 13px; }
    .feature-text { font-size: 11px; }
}