body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0f172a;
    color: white;
}

@view-transition {
    navigation: auto;
}

/* @supports (view-transition-name: article-image) {
    ::view-transition-old(article-image), ::view-transition-new(article-image) {
        transition: transform 420ms ease, opacity 420ms ease;
    }
} */

a {
    color: #ffffff;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    gap: 20px;
}

h1 {
    font-size: 42px;
    margin: 0;
}

.subtitle {
    color: #94a3b8;
    margin-top: 8px;
}

.compatibility {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 16px 20px;
    border-radius: 20px;
    text-align: center;
    min-width: 180px;
}

.compatibility .label {
    font-size: 12px;
    color: #94a3b8;
}

.compatibility .value {
    font-size: 28px;
    font-weight: bold;
    margin-top: 4px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    margin: 20px;
    position: relative;
    padding: 24px;
    border-radius: 28px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

.gradient {
    position: absolute;
    inset: 0;
    opacity: 0.25;
}

.card-content {
    position: relative;
    z-index: 2;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.name {
    font-size: 26px;
    font-weight: bold;
}

.battery-box {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.bar {
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    overflow: hidden;
}

.fill {
    height: 100%;
    border-radius: 999px;
}

.info {
    margin-top: 18px;
    color: #cbd5e1;
}

.insights {
    margin-top: 20px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}

.insights li {
    margin-bottom: 8px;
    color: #cbd5e1;
}

@media (max-width: 800px) {
    .grid {
    grid-template-columns: 1fr;
    }
    .header {
    flex-direction: column;
    align-items: flex-start;
    }
}

.mbti-option {
    position: relative;
    cursor: pointer;
}

.mbti-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

/* Выделение при выборе */
.mbti-option input[type="radio"]:checked + .card {
    border: 2px solid #007bff;
    background-color: #f0f8ff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
    transform: scale(1.02);
}

/* Эффект при наведении */
.mbti-option:hover .card {
    border-color: #cce5ff;
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

/* Стили для страницы регистрации */
.registration-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Сетка для карточек MBTI */
.mbti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

/* Контейнер для radio + карточки */
.mbti-option {
    position: relative;
    cursor: pointer;
    display: block;
}

/* Скрываем стандартный radio */
.mbti-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Стили карточки */
.mbti-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    /* height: 100%; */
    display: flex;
    flex-direction: column;
}

/* Обертка для изображения */
.mbti-card-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mbti-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Контент карточки */
.mbti-card-content {
    padding: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
}

.mbti-code {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
    display: block;
}

.mbti-name {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.3;
}

/* Эффекты при наведении */
.mbti-option:hover .mbti-card {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.mbti-option:hover .mbti-card-image img {
    transform: scale(1.05);
}

/* Выделение выбранной карточки */
.mbti-option input[type="radio"]:checked + .mbti-card {
    border-color: #3b82f6;
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), 0 8px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
}

.mbti-option input[type="radio"]:checked + .mbti-card .mbti-code {
    color: #60a5fa;
}

.mbti-option input[type="radio"]:checked + .mbti-card .mbti-name {
    color: #93c5fd;
}

/* Анимация при выборе */
.mbti-option input[type="radio"]:checked + .mbti-card {
    animation: cardSelect 0.4s ease;
}

@keyframes cardSelect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Стили для полей формы (адаптация под темную тему) */
.registration-card input:not([type="radio"]) {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.3s ease;
}

.registration-card input:not([type="radio"]):focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.registration-card label {
    color: #cbd5e1;
    margin-bottom: 5px;
    display: block;
}

.registration-card .form-text {
    color: #94a3b8;
    font-size: 12px;
}

/* Адаптивность */


/* Утилиты */
.text-center {
    text-align: center;
}

.w-100 {
    width: 100%;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

/* Bootstrap-совместимость (если не используете Bootstrap) */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    padding: 12px;
    font-weight: bold;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.top_bat{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
*{box-sizing:border-box;margin:0;padding:0}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.app{padding:2rem 1.25rem 2.5rem;display:flex;flex-direction:column;align-items:center;gap:1.5rem;font-family:var(--font-sans);color:#fff}
.top-bar{width:100%;max-width:520px;display:flex;justify-content:space-between;align-items:center}
.app-title{font-size:13px;font-weight:500;color:rgba(255,255,255,0.25);letter-spacing:.2em;text-transform:uppercase}
.pill{display:flex;align-items:center;gap:6px;font-size:12px;color:rgba(255,255,255,0.35);background:rgba(255,255,255,0.05);border:.5px solid rgba(255,255,255,0.1);border-radius:20px;padding:4px 12px}
.odot{width:6px;height:6px;border-radius:50%;background:#4ade80;animation:blink 2s ease-in-out infinite}
@keyframes blink{0%,100%{opacity:1}50%{opacity:.3}}
.grid{display:flex;flex-direction:column;align-items:center;}
.brow{display:flex;align-items:center;justify-content:space-between;gap:6rem}
.bcard{display:flex;flex-direction:column;align-items:center;gap:12px}
.btip{width:30px;height:9px;border-radius:4px 4px 0 0;background:rgba(255,255,255,0.08);margin-bottom:-1px;position:relative;z-index:1}
.bbody{width:100px;height:218px;border-radius:22px;border:0.5px solid rgba(255,255,255,0.1);position:relative;overflow:hidden;background:rgba(255,255,255,0.025);transition:box-shadow .6s ease,border-color .6s ease}
.bbody::after{content:'';position:absolute;top:12px;left:10px;width:11px;bottom:12px;border-radius:6px;background:rgba(255,255,255,0.08);z-index:10;pointer-events:none}
canvas.liq{position:absolute;bottom:0;left:0;width:100px;height:218px}
.pct{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:16px;font-weight:500;color:#fff;z-index:20;pointer-events:none;text-shadow:0 1px 8px rgba(0,0,0,0.7)}
.bname{font-size:13px;color:rgba(255,255,255,0.38);}
.panel{width:100%;max-width:520px;background:rgba(255,255,255,0.04);border:.5px solid rgba(255,255,255,0.08);border-radius:20px;padding:1.25rem}
.plabel{font-size:11px;color:rgba(255,255,255,0.28);letter-spacing:.1em;text-transform:uppercase;margin-bottom:.75rem}
.mrow{display:flex;gap:8px}
.mbtn{flex:1;padding:10px 6px;border-radius:14px;border:1px solid rgba(255,255,255,0.08);background:rgba(255,255,255,0.04);color:rgba(255,255,255,0.58);font-size:12px;cursor:pointer;text-align:center;display:flex;flex-direction:column;align-items:center;gap:5px;transition:all .2s;font-family:var(--font-sans)}
.mbtn:hover{background:rgba(255,255,255,0.09);border-color:rgba(255,255,255,0.18);transform:translateY(-1px)}
.mbtn.active{border-color:#a78bfa;background:rgba(124,58,237,0.2);color:#c4b5fd}
.mem{font-size:20px}
.qh{display:flex;justify-content:space-between;align-items:center;margin-bottom:.875rem}
.qtag{font-size:11px;color:#a78bfa;background:rgba(124,58,237,0.15);border:.5px solid rgba(124,58,237,0.3);border-radius:6px;padding:3px 9px;text-transform:uppercase;letter-spacing:.08em}
.qnum{font-size:12px;color:rgba(255,255,255,0.22)}
.qq{font-size:15px;color:rgba(255,255,255,0.85);line-height:1.5;margin-bottom:1rem}
.qopts{display:flex;flex-direction:column;gap:7px}
.qopt{padding:11px 14px;border-radius:12px;border:1px solid rgba(255,255,255,0.07);background:rgba(255,255,255,0.03);color:rgba(255,255,255,0.58);font-size:13px;cursor:pointer;transition:all .2s;text-align:left;font-family:var(--font-sans)}
.qopt:hover{background:rgba(124,58,237,0.15);border-color:rgba(167,139,250,0.3);color:rgba(255,255,255,0.9)}
.qopt.sel{border-color:#a78bfa;background:rgba(124,58,237,0.25);color:#c4b5fd}
.sbtn{margin-top:.875rem;width:100%;padding:13px;border-radius:12px;border:none;background:rgba(124,58,237,0.18);color:rgba(255,255,255,0.28);font-size:14px;font-weight:500;font-family:var(--font-sans);cursor:default;transition:all .25s}
.sbtn.ready{background:#7c3aed;color:#fff;cursor:pointer}
.sbtn.ready:hover{background:#6d28d9;transform:translateY(-1px)}
.arow{display:flex;gap:8px;width:100%;max-width:520px}
.abtn{flex:1;background:rgba(255,255,255,0.04);border:.5px solid rgba(255,255,255,0.08);border-radius:16px;padding:.875rem .5rem;display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer;transition:all .2s;font-family:var(--font-sans)}
.abtn:hover{background:rgba(255,255,255,0.08);transform:translateY(-2px)}
.aem{font-size:20px}
.albl{font-size:11px;color:rgba(255,255,255,0.38)}
/* SYNC INDICATOR */
.syncbar { width: 100%; max-width: 520px; background: rgba(255,255,255,0.04); border: 0.5px solid rgba(255,255,255,0.08); border-radius: 20px; padding: 1rem 1.25rem; display: flex; align-items: center; gap: 12px; }
.syncicon { font-size: 20px; color: rgba(255,255,255,0.58); }
.synctxt { flex: 1; }
.synctitle { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85); margin-bottom: 2px; }
.syncdesc { font-size: 12px; color: rgba(255,255,255,0.38); line-height: 1.4; }
.syncbtn { font-size: 12px; background: rgba(255,255,255,0.08); border: 0.5px solid rgba(255,255,255,0.12); border-radius: 14px; padding: 6px 14px; cursor: pointer; color: rgba(255,255,255,0.58); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; transition: all 0.15s; }
.syncbtn:hover { background: rgba(124,58,237,0.2); border-color: rgba(167,139,250,0.3); color: #c4b5fd; transform: translateY(-1px); }
/* History Chart */
.history-chart { width: 100%; max-width: 520px; background: rgba(255,255,255,0.04); border: 0.5px solid rgba(255,255,255,0.08); border-radius: 20px; padding: 1rem; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.chart-title { font-size: 11px; color: rgba(255,255,255,0.28); letter-spacing: 0.1em; text-transform: uppercase; }
.chart-period { display: flex; gap: 8px; }
.period-btn { font-size: 10px; padding: 4px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 0.5px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.45); cursor: pointer; transition: all 0.15s; }
.period-btn:hover { background: rgba(124,58,237,0.2); border-color: rgba(167,139,250,0.3); color: #c4b5fd; }
.period-btn.active { background: rgba(124,58,237,0.25); border-color: #a78bfa; color: #c4b5fd; }
canvas#batteryHistoryChart { max-height: 200px; width: 100% !important; }
