:root {
    --bg: #07111d;
    --bg-soft: #0f1c2d;
    --surface: rgba(12, 27, 44, 0.7);
    --surface-strong: rgba(7, 17, 29, 0.86);
    --line: rgba(173, 217, 255, 0.12);
    --line-strong: rgba(173, 217, 255, 0.24);
    --text: #eef6ff;
    --muted: #9eb5ca;
    --accent: #4ef0c3;
    --accent-deep: #11b3a3;
    --warn: #ff9e64;
    --danger: #ff6f7d;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(78, 240, 195, 0.16), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(255, 158, 100, 0.16), transparent 24%),
        linear-gradient(180deg, #091523 0%, #050c15 100%);
    font-family: "Manrope", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.page-shell,
.shell {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.page-shell {
    padding: 32px 0 56px;
}

.glass-card,
.metric-card,
.plan-card,
.renew-card,
.banner-card,
.flash,
.empty-state,
.content-card,
.side-card {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(18, 34, 54, 0.82), rgba(8, 16, 28, 0.9));
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.hero-panel,
.cabinet-hero,
.banner-row,
.stats-grid,
.cabinet-grid,
.plan-grid,
.renew-grid {
    display: grid;
    gap: 20px;
}

.hero-panel {
    align-items: stretch;
    grid-template-columns: 1.2fr 0.8fr;
    padding-top: 28px;
}

.hero-copy,
.hero-card,
.lookup-panel,
.content-card,
.side-card,
.empty-state {
    border-radius: var(--radius-xl);
    padding: 30px;
}

.eyebrow {
    margin: 0 0 14px;
    font: 700 0.8rem/1 "Space Grotesk", sans-serif;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}

h1,
h2,
h3,
strong {
    font-family: "Space Grotesk", sans-serif;
}

h1 {
    margin: 0;
    font-size: clamp(2.7rem, 7vw, 5.4rem);
    line-height: 0.95;
    max-width: 12ch;
}

h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
}

h3 {
    margin: 0;
    font-size: 1.4rem;
}

.hero-text,
.hero-note,
.lookup-panel p,
.metric-card p,
.plan-card p,
.renew-card p,
.history-item p,
.muted,
.summary-meta,
.empty-state p {
    color: var(--muted);
    line-height: 1.65;
}

.hero-actions,
.hero-card-top,
.section-heading,
.section-heading.compact,
.history-item,
.payment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.hero-actions {
    margin-top: 26px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
    cursor: pointer;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #75ffd7 100%);
    color: #04231f;
    box-shadow: 0 16px 40px rgba(78, 240, 195, 0.28);
}

.button-ghost {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.03);
}

.hero-card {
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: auto -40px -80px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 158, 100, 0.35), transparent 65%);
}

.hero-kpis {
    display: grid;
    gap: 14px;
    margin: 22px 0 18px;
}

.hero-kpis article,
.banner-card,
.metric-card,
.plan-card,
.renew-card,
.history-item,
.payment-item {
    position: relative;
    overflow: hidden;
}

.hero-kpis article {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.hero-kpis strong,
.metric-card strong,
.plan-card strong,
.renew-card strong,
.summary-label,
.detail-list dd {
    display: block;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(78, 240, 195, 0.7);
}

.banner-row {
    grid-template-columns: repeat(3, 1fr);
    margin: 28px 0;
}

.banner-card {
    padding: 18px 20px;
    border-radius: 22px;
}

.banner-card span,
.metric-card span,
.summary-label,
.plan-card span,
.renew-card span,
.detail-list dt {
    color: var(--muted);
    font-size: 0.94rem;
}

.flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.flash {
    border-radius: 20px;
    padding: 16px 20px;
}

.flash-success {
    border-color: rgba(78, 240, 195, 0.3);
}

.flash-error {
    border-color: rgba(255, 111, 125, 0.3);
}

.lookup-panel {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    margin-bottom: 34px;
}

.lookup-form {
    display: grid;
    gap: 12px;
    align-content: start;
}

.lookup-form input {
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.plans-section {
    padding-top: 8px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading.compact {
    margin-bottom: 20px;
    align-items: end;
}

.section-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.button-compact {
    min-height: 46px;
}

.plan-grid {
    grid-template-columns: repeat(3, 1fr);
}

.plan-card,
.renew-card,
.metric-card {
    border-radius: 26px;
    padding: 24px;
}

.plan-badge,
.pill {
    display: inline-flex;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.plan-badge,
.pill-brand {
    color: #04231f;
    background: linear-gradient(135deg, var(--accent) 0%, #b9ffe9 100%);
}

.pill-success {
    color: #062218;
    background: #95f4d5;
}

.pill-muted {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.cabinet-hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: end;
    margin-bottom: 24px;
}

.cabinet-summary {
    min-height: 100%;
    display: grid;
    gap: 14px;
}

.summary-panel {
    align-content: start;
    padding: 28px 30px;
}

.summary-code {
    font-size: clamp(1.15rem, 2.5vw, 1.6rem);
    line-height: 1.25;
    word-break: break-word;
}

.summary-link {
    display: block;
    word-break: break-all;
}

.summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.summary-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.back-link {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--muted);
}

.stats-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 22px;
}

.cabinet-stats .metric-card {
    min-height: 184px;
}

.metric-card strong {
    margin: 10px 0 6px;
    font-size: 1.45rem;
}

.cabinet-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    align-items: start;
}

.stack-column {
    display: grid;
    gap: 20px;
}

.renew-grid {
    grid-template-columns: repeat(3, 1fr);
}

.renew-card form {
    margin-top: 18px;
}

.history-list,
.payment-list {
    display: grid;
    gap: 12px;
}

.devices-card {
    display: grid;
    gap: 22px;
}

.device-add-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
}

.device-add-copy {
    display: grid;
    gap: 12px;
    align-content: start;
}

.device-limit-note {
    margin: 0;
    color: var(--text);
}

.device-list {
    display: grid;
    gap: 12px;
}

.device-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
}

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

.device-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.device-platform,
.device-note {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.device-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.device-empty {
    padding: 18px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.02);
}

.device-empty strong {
    margin-bottom: 4px;
}

.button-danger {
    border-color: rgba(255, 111, 125, 0.28);
    color: #ffd4da;
}

.button-danger:hover {
    background: rgba(255, 111, 125, 0.08);
}

.button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.button:disabled:hover {
    transform: none;
}

.history-item,
.payment-item {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.history-item strong,
.payment-item strong {
    margin-bottom: 4px;
}

.detail-list {
    display: grid;
    gap: 16px;
    margin: 18px 0 0;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.detail-list div:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.detail-list dd {
    margin: 0;
    text-align: right;
}

.plain-list {
    margin: 18px 0 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.7;
}

.empty-state {
    text-align: center;
    margin-top: 42px;
}

.empty-state h1,
.empty-state h2 {
    max-width: none;
}

.notice-card {
    border-color: rgba(255, 158, 100, 0.2);
}

@media (max-width: 1100px) {
    .hero-panel,
    .lookup-panel,
    .cabinet-hero,
    .cabinet-grid,
    .stats-grid,
    .device-add-panel,
    .renew-grid,
    .plan-grid,
    .banner-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .page-shell {
        padding: 18px 0 42px;
    }

    .hero-copy,
    .hero-card,
    .lookup-panel,
    .content-card,
    .side-card,
    .metric-card,
    .plan-card,
    .renew-card,
    .empty-state {
        padding: 22px;
        border-radius: 24px;
    }

    h1 {
        font-size: clamp(2.2rem, 14vw, 3.8rem);
    }

    .button,
    .lookup-form input {
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .section-heading-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .device-card,
    .device-title-row,
    .history-item,
    .payment-item,
    .section-heading,
    .section-heading.compact {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-list div {
        flex-direction: column;
    }

    .detail-list dd {
        text-align: left;
    }
}
