*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --pink:   #ec4899;
    --purple: #a855f7;
    --bg:     #fafafa;
    --text:   #111;
    --muted:  #9ca3af;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    position: relative;
    padding: 3rem 1rem;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.wordmark {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3.5rem;
    text-align: center;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Dashboard ── */
.card {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    max-width: 400px;
    animation: fadeUp 0.6s ease both;
}

.sub-block {
    margin-bottom: 3rem;
}

.sub-block:last-of-type {
    margin-bottom: 0;
}

/* Category label above plan name */
.cat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.plan-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

/* Inactive/superseded plans are visually dimmed */
.sub-block.inactive .plan-name,
.sub-block.inactive .meta-value {
    color: var(--muted);
}

.meta {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
}

.meta-row {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    font-size: 0.78rem;
}

.meta-label {
    color: var(--muted);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.meta-value {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text);
}

/* Specs rows */
.specs {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: center;
}

.spec-row {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    font-size: 0.75rem;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.divider {
    width: 1px;
    height: 2.5rem;
    background: linear-gradient(to bottom, transparent, var(--muted), transparent);
    margin: 1.75rem auto;
}

.sub-divider {
    width: 40px;
    height: 1px;
    background: #e5e7eb;
    margin: 2.5rem auto;
}

.renew {
    display: inline-block;
    margin-top: 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: white;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    text-decoration: none;
    padding: 0.65rem 1.75rem;
    transition: opacity 0.2s;
}

.renew:hover {
    opacity: 0.8;
}

/* Manage link — subtle, secondary action */
.manage-link {
    display: inline-block;
    margin-top: 0.6rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.manage-link:hover {
    color: var(--purple);
}

.logout {
    display: inline-block;
    margin-top: 2rem;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.logout:hover {
    color: var(--pink);
}

.no-subs {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

/* Floating bill */
.bill {
    position: fixed;
    top: <?php echo $bill_top; ?>%;
    left: <?php echo $bill_left; ?>%;
    z-index: 2;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 2.5vw, 0.9rem);
    color: var(--purple);
    opacity: 0;
    animation: fadeUp 0.4s ease 1.2s both;
    white-space: nowrap;
    cursor: default;
    user-select: none;
    transition: opacity 0.2s;
}

.bill:hover {
    opacity: 0 !important;
}

/* ── Login ── */
.login-wrap {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    max-width: 300px;
    padding: 0 2rem;
    animation: fadeUp 0.6s ease both;
}

.login-wrap input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-wrap input::placeholder {
    color: var(--muted);
    letter-spacing: 0.05em;
}

.login-wrap input:focus {
    border-bottom-color: var(--pink);
}

.login-wrap button {
    margin-top: 0.5rem;
    background: none;
    border: 1px solid var(--pink);
    color: var(--pink);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.75rem 2rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    width: 100%;
}

.login-wrap button:hover {
    background: var(--pink);
    color: white;
}

.login-error {
    margin-top: 1.25rem;
    font-size: 0.7rem;
    color: var(--muted);
    font-family: 'IBM Plex Mono', monospace;
}