/* ══════════════════════════════════════════════════════════════════
   HEADER — только переключатель темы
══════════════════════════════════════════════════════════════════ */
.header {
    padding: 14px 16px 10px;
    padding-top:  calc(14px + var(--sa-top) + var(--csa-top));
    padding-left: calc(16px + var(--csa-left) + var(--sa-left));
    padding-right: calc(16px + var(--csa-right) + var(--sa-right));
    display: flex;
    justify-content: flex-end;
}


/* ── ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ — капсула ── */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 50px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 12px rgba(44, 100, 110, 0.14);
    cursor: pointer;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.2px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.theme-toggle .toggle-icon { font-size: 18px; line-height: 1; }
.theme-toggle .toggle-label { font-size: 13px; }
.theme-toggle:active { transform: scale(0.93); }

/* Dark theme overrides for hero and toggle */
[data-theme="dark"] .hero-card {
    background: linear-gradient(120deg, #0d2828 0%, #153d3d 35%, #1e5555 65%, #0a1a1a 100%);
}
[data-theme="dark"] .hero-label { color: rgba(160, 200, 200, 0.65); }
[data-theme="dark"] .hero-name { color: #c8e8e8; }
[data-theme="dark"] .hero-photo::after {
    background: linear-gradient(to right, #153d3d 0%, transparent 100%);
}
[data-theme="dark"] .theme-toggle {
    background: rgba(10, 25, 41, 0.92);
    border-color: rgba(44, 150, 150, 0.22);
}

/* ══════════════════════════════════════════════════════════════════
   ДВУХКОЛОНОЧНЫЙ БЛОК: инфо + тарифы
══════════════════════════════════════════════════════════════════ */
.main-grid {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: 12px;
    margin: 0 16px 12px;
    margin-left: calc(16px + var(--csa-left) + var(--sa-left));
    margin-right: calc(16px + var(--csa-right) + var(--sa-right));
    align-items: stretch;
}

/* info-card внутри grid */
.info-card {
    margin: 0;
}

/* ── КАРТОЧКА ТАРИФЫ + РЕФЕРАЛ — стеклянная с золотым акцентом ── */
.tariff-tile {
    min-height: 100%;
    background: linear-gradient(135deg, #1a3c40 0%, #1f4e52 50%, #1a3c40 100%);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(227, 179, 65, 0.40);
    box-shadow:
        0 0 20px rgba(227, 179, 65, 0.28),
        0 4px 16px rgba(20, 60, 64, 0.25),
        inset 0 1px 0 rgba(255,255,255,0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    opacity: 0;
    transform: translateY(28px) scale(0.93);
    position: relative;
}

/* Золотой glow сверху */
.tariff-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: radial-gradient(ellipse at 50% 0%, rgba(227, 179, 65, 0.14) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.tariff-tile:active {
    transform: scale(0.94);
    box-shadow:
        0 0 28px rgba(227, 179, 65, 0.45),
        0 4px 16px rgba(44, 100, 100, 0.10);
}

/* Верхняя зона — тарифы */
.tariff-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 10px 10px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}
.tariff-top:active { opacity: 0.75; }

.tariff-icon {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(227,179,65,0.5));
}

.tariff-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--gold2);
    text-align: center;
    letter-spacing: 0.2px;
    font-family: 'Syne', sans-serif;
    line-height: 1.2;
}
[data-theme="dark"] .tariff-label { color: #f5d070; }

/* Разделитель */
.tariff-divider {
    height: 1px;
    background: rgba(227, 179, 65, 0.30);
    margin: 0 12px;
    position: relative;
    z-index: 1;
}

/* Нижняя зона — реферал */
.tariff-ref {
    padding: 9px 10px 11px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.tariff-ref-label {
    font-size: 8px;
    font-weight: 700;
    color: var(--sub);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: center;
}
[data-theme="dark"] .tariff-ref-label { color: rgba(160,170,180,0.7); }

.tariff-ref-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    background: rgba(227, 179, 65, 0.12);
    border: 1px solid rgba(227, 179, 65, 0.35);
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 10px;
    font-weight: 700;
    color: var(--gold2);
    font-family: 'Syne', sans-serif;
    width: 100%;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.tariff-ref-btn:active { background: rgba(227, 179, 65, 0.25); }
[data-theme="dark"] .tariff-ref-btn { color: #f5d070; border-color: rgba(227,179,65,0.35); }

/* ══════════════════════════════════════════════════════════════════
   HERO CARD — текст СЛЕВА, фото СПРАВА, точки справа за фото
══════════════════════════════════════════════════════════════════ */
.hero-wrapper {
    padding: 0 16px 12px;
    padding-left: calc(16px + var(--csa-left) + var(--sa-left));
    padding-right: calc(16px + var(--csa-right) + var(--sa-right));
}

.hero-card {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(120deg, #b8e8ea 0%, #7ecece 30%, #3aa8a8 65%, #1e7878 100%);
    height: 245px;
}

/* Точечный паттерн — ПРАВАЯ часть (за фото) */
.hero-dots {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60%;
    pointer-events: none;
    z-index: 1;
}
.hero-dots::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(20, 80, 80, 0.42) 1.4px, transparent 1.4px);
    background-size: 11px 11px;
    background-position: 2px 2px;
}

/* ТЕКСТ — СЛЕВА */
.hero-text {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 56%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 8px 24px 22px;
    z-index: 3;
}

.hero-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(10, 45, 50, 0.60);
    letter-spacing: 0.1px;
    margin-bottom: 6px;
    font-family: 'DM Sans', sans-serif;
}

.hero-name {
    font-family: 'Syne', sans-serif;
    font-size: clamp(22px, 6.5vw, 30px);
    font-weight: 800;
    color: #0d2020;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

/* Hero sub (ID line) */
.hero-sub {
    font-size: 10px;
    color: rgba(10, 45, 50, 0.50);
    margin-top: 6px;
    font-family: monospace;
}
[data-theme="dark"] .hero-sub { color: rgba(160, 200, 200, 0.50); }

/* ФОТО — СПРАВА, на всю высоту карточки */
.hero-photo {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    overflow: hidden;
    z-index: 2;
}

/* Плавный fade слева от фото */
.hero-photo::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 70px;
    background: linear-gradient(to right, #3aa8a8 0%, transparent 100%);
    z-index: 3;
    pointer-events: none;
}

/* Реальное фото из Telegram */
.hero-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Fallback: инициалы на панели фото */
.hero-avatar-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(255,255,255,0.18) 0%, rgba(0,0,0,0.08) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.hero-avatar-fallback .fallback-initials {
    font-family: 'Syne', sans-serif;
    font-size: 56px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1;
    text-shadow: 0 3px 16px rgba(0,0,0,0.25);
}
.hero-avatar-fallback .fallback-icon {
    font-size: 22px;
    opacity: 0.6;
}

/* ── INFO CARD — dark emerald teal ── */
.info-card {
    margin: 10px 16px 0;
    margin-left: calc(16px + var(--csa-left) + var(--sa-left));
    margin-right: calc(16px + var(--csa-right) + var(--sa-right));
    background: linear-gradient(135deg, #1a3c40 0%, #1f4e52 50%, #1a3c40 100%);
    border-radius: 20px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 6px 24px rgba(20, 60, 64, 0.32);
}

.info-card::before {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-icon-box {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.info-text-label {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.60);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.info-text-val {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 2px;
}

/* Тёмная тема: info-card ещё темнее teal */
[data-theme="dark"] .info-card {
    background: linear-gradient(135deg, #0d1e22 0%, #122830 50%, #0d1e22 100%);
    border-color: rgba(44, 150, 150, 0.20);
    box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

/* ── SOON BADGE ── */
.soon-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #e85050, #c03030);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    font-family: 'Syne', sans-serif;
    letter-spacing: 0.3px;
    padding: 2px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(232,80,80,0.35);
}

/* ══════════════════════════════════════════════════════════════════
   TILES (compact row) — BOTTOM NAV
══════════════════════════════════════════════════════════════════ */
.tiles-compact-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0 16px;
    padding-left:   calc(16px + var(--csa-left)  + var(--sa-left));
    padding-right:  calc(16px + var(--csa-right) + var(--sa-right));
    padding-bottom: calc(20px + var(--sa-bottom) + var(--csa-bottom));
}

.tile-compact {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 14px 6px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 82px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(44, 100, 100, 0.12), inset 0 1px 0 rgba(255,255,255,0.6);
    border: 1px solid var(--glass-border);
    opacity: 0;
    transform: translateY(28px) scale(0.93);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile-compact.tile-blue  { border-color: var(--glass-border); }
.tile-compact.tile-gold  { border-color: var(--glass-border); }
.tile-compact.tile-green { border-color: var(--glass-border); }

.tile-compact:active { transform: scale(0.93); box-shadow: 0 1px 5px rgba(44,100,100,0.2); }
.tile-compact.tile-blue:active  { box-shadow: 0 0 16px rgba(44, 150, 150, 0.2), 0 1px 5px rgba(44,100,100,0.2); }
.tile-compact.tile-gold:active  { box-shadow: 0 0 16px rgba(227, 179, 65, 0.2),  0 1px 5px rgba(44,100,100,0.2); }
.tile-compact.tile-green:active { box-shadow: 0 0 16px rgba(42, 184, 112, 0.2),  0 1px 5px rgba(44,100,100,0.2); }

.tile-compact .compact-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.tile-compact .compact-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    color: var(--text);
    line-height: 1.2;
}
/* Dark theme — tile-compact text must stay light */
[data-theme="dark"] .tile-compact .compact-label { color: var(--text); }

/* Profile plan status line */
.profile-plan-status {
    font-size: 11px;
    color: var(--sub2);
    margin-top: 3px;
    font-weight: 500;
}
.profile-plan-status .plan-name-admin    { color: var(--purple); }

.tile {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(44, 100, 100, 0.1);
    opacity: 0;
    transform: translateY(28px) scale(0.93);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:active {
    transform: scale(0.96);
    box-shadow: 0 1px 6px rgba(44, 100, 100, 0.2);
}

.tile-blue:active  { box-shadow: 0 0 20px rgba(44, 150, 150, 0.15), 0 1px 6px rgba(44, 100, 100, 0.2); }
.tile-gold:active  { box-shadow: 0 0 20px rgba(227, 179, 65, 0.15), 0 1px 6px rgba(44, 100, 100, 0.2); }
.tile-green:active { box-shadow: 0 0 20px rgba(42,  184, 112, 0.15), 0 1px 6px rgba(44, 100, 100, 0.2); }

.tile-blue  { border-color: rgba(44, 150, 150, 0.2); }
.tile-gold  { border-color: rgba(227, 179, 65, 0.2); }
.tile-green { border-color: rgba(42,  184, 112, 0.2); }

.icon-blue  { background: rgba(44, 150, 150, 0.15); }
.icon-gold  { background: rgba(227, 179, 65, 0.15); }
.icon-green { background: rgba(42,  184, 112, 0.15); }

.profile-id {
    font-size: 11px;
    color: var(--sub);
    font-family: monospace;
    margin-top: 2px;
}

.days-left {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 8px;
}

.days-left.urgent  { background: rgba(232, 80,  80,  0.12); color: var(--red);  border: 1px solid rgba(232, 80,  80,  0.25); animation: urgentPulse 1.5s ease-in-out infinite; }
.days-left.warning { background: rgba(227, 179, 65,  0.15); color: var(--gold2); border: 1px solid rgba(227, 179, 65,  0.25); }
.days-left.ok      { background: rgba(42,  184, 112, 0.1);  color: var(--green); border: 1px solid rgba(42,  184, 112, 0.2);  }

@keyframes urgentPulse {
    0%, 100% { opacity: 1;   }
    50%       { opacity: 0.6; }
}

.renew-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    animation: renewPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes renewPop {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1);   }
}

.tile.animate {
    animation: tileIn 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tileIn {
    0%   { opacity: 0; transform: translateY(28px) scale(0.93); }
    55%  { opacity: 1; transform: translateY(-5px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0)    scale(1);    }
}
