:root {
    --bg-0: #08060d;
    --bg-1: #0f0b1a;
    --bg-2: #16102a;
    --purple-1: #8b5cf6;
    --purple-2: #a78bfa;
    --purple-glow: #7c3aed;
    --text-hi: #f3f0ff;
    --text-lo: #b8b0cc;
    --border: rgba(139, 92, 246, 0.18);
    --danger: #f87171;
    --success: #34d399;
    --radius: 18px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg-0);
    color: var(--text-hi);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.25), transparent 45%),
        radial-gradient(circle at 80% 30%, rgba(124, 58, 237, 0.20), transparent 50%),
        radial-gradient(circle at 50% 90%, rgba(167, 139, 250, 0.15), transparent 55%),
        var(--bg-0);
    animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
    0%   { filter: hue-rotate(0deg) brightness(1); }
    100% { filter: hue-rotate(12deg) brightness(1.08); }
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    animation: fadeDown 0.6s ease both;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-hi); }
.site-nav { display: flex; align-items: center; gap: 10px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 18px rgba(139,92,246,0.55); }
.brand span { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.3px; }

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.card {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 32px;
    text-align: center;
    animation: riseIn 0.7s cubic-bezier(.2,.8,.2,1) both;
}

.card img.logo {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    margin-bottom: 18px;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.45);
    animation: floaty 4s ease-in-out infinite;
}

.hero {
    width: 100%;
    max-width: 640px;
    text-align: center;
    animation: riseIn 0.7s cubic-bezier(.2,.8,.2,1) both;
}

.hero-banner {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 28px;
    animation: floaty 5s ease-in-out infinite;
}

.hero h1 { font-size: 1.9rem; margin: 0 0 10px; }
.hero-hint { color: var(--text-lo); margin: 0 0 28px; font-size: 1rem; line-height: 1.5; }

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.hero-actions .btn { width: auto; padding: 14px 28px; }

#hero-login-btn { animation: pulseGlow 2.2s ease-in-out infinite; }
#hero-login-btn:hover { animation-play-state: paused; }

h1 { font-size: 1.5rem; margin: 0 0 6px; }
p.subtitle { color: var(--text-lo); margin: 0 0 26px; font-size: 0.95rem; line-height: 1.5; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--purple-1), var(--purple-glow));
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(139, 92, 246, 0.5); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; pointer-events: none; }

.auth-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-top: 6px;
}
.auth-box .notice { margin: 0; }
.auth-box .consent-check { margin: 0; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0;
    color: var(--text-lo);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-box:has(#consent-checkbox:checked) #discord-login-btn {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    animation: pulseGlow 2.2s ease-in-out infinite;
}
.auth-box:has(#consent-checkbox:checked) #discord-login-btn:hover {
    animation-play-state: paused;
}

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    color: var(--text-lo);
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 18px 0;
    cursor: pointer;
    user-select: none;
}

.consent-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.06);
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.consent-check input[type="checkbox"]:hover {
    border-color: var(--purple-1);
}

.consent-check input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--purple-1), var(--purple-glow));
    border-color: var(--purple-1);
}

.consent-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.consent-check input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--purple-2);
    outline-offset: 2px;
}

.notice {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.88rem;
    margin: 0 0 18px;
    text-align: left;
}
.notice-err {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--danger);
}
.notice-info {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid var(--border);
    color: var(--text-lo);
}
.notice-info strong { color: var(--purple-2); }

.btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    box-shadow: none;
    color: var(--text-lo);
}
.btn.secondary:hover { color: var(--text-hi); border-color: var(--purple-1); }

.btn svg { width: 20px; height: 20px; }

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.profile img.avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--purple-1);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
    animation: floaty 5s ease-in-out infinite;
}

.profile .name { font-size: 1.2rem; font-weight: 700; }
.profile .tag { color: var(--text-lo); font-size: 0.9rem; }

.steps {
    text-align: left;
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    margin: 20px 0;
    font-size: 0.92rem;
    color: var(--text-lo);
    line-height: 1.6;
}
.steps code {
    background: rgba(139, 92, 246, 0.18);
    color: var(--purple-2);
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 600;
}

.actions { display: flex; flex-direction: column; gap: 12px; }

.toast {
    margin-top: 14px;
    font-size: 0.88rem;
    min-height: 1.2em;
}
.toast.ok { color: var(--success); }
.toast.err { color: var(--danger); }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 6, 13, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.overlay.active { display: flex; }

.spinner {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--purple-1);
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    display: none;
}
.btn.loading .spinner-sm { display: inline-block; }
.btn.loading .btn-label { opacity: 0.85; }

.instructions-card { text-align: left; max-width: 640px; }
.instructions-card h1 { text-align: center; }
.instructions-content {
    color: var(--text-lo);
    font-size: 0.96rem;
    line-height: 1.7;
}
.instructions-content h2 {
    color: var(--purple-2);
    font-size: 1.1rem;
    margin: 24px 0 10px;
}
.instructions-content h2:first-child { margin-top: 0; }
.instructions-content code {
    background: rgba(139, 92, 246, 0.18);
    color: var(--purple-2);
    padding: 2px 7px;
    border-radius: 6px;
}

.status-main { align-items: flex-start; padding-top: 56px; }
.status-wrap { width: 100%; max-width: 640px; margin: 0 auto; }

.status-hero {
    text-align: center;
    margin-bottom: 44px;
    animation: riseIn 0.7s cubic-bezier(.2,.8,.2,1) both;
}

.status-hero-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    animation: floaty 4s ease-in-out infinite;
}
.status-hero-icon.status-ok {
    background: linear-gradient(135deg, var(--success), #16a34a);
    box-shadow: 0 0 40px rgba(52, 211, 153, 0.45);
}
.status-hero-icon.status-err {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    box-shadow: 0 0 40px rgba(248, 113, 113, 0.45);
}
.status-hero-icon.status-unknown {
    background: linear-gradient(135deg, var(--text-lo), #6b7280);
    box-shadow: 0 0 40px rgba(184, 176, 204, 0.3);
}

.status-hero-title { font-size: 1.9rem; margin: 0 0 6px; }
.status-hero-sub { color: var(--text-lo); margin: 0; font-size: 0.95rem; }

.status-section {
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    animation: riseIn 0.8s cubic-bezier(.2,.8,.2,1) both;
}

.status-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.status-section-head h2 { margin: 0; font-size: 1.1rem; }

.status-tab-nav {
    display: flex;
    gap: 4px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
}

.status-tab-btn {
    text-align: center;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-lo);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.status-tab-btn input { display: none; }
.status-tab-btn:has(input:checked) {
    background: linear-gradient(135deg, var(--purple-1), var(--purple-glow));
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.status-panel { display: none; }
.status-section:has(#tab-products:checked) .panel-products { display: block; }
.status-section:has(#tab-servers:checked) .panel-servers { display: block; }

.status-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-row-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    transition: transform 0.15s ease, background 0.15s ease;
    animation: riseIn 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.status-row-card:hover {
    transform: translateY(-1px);
    background: rgba(139, 92, 246, 0.08);
}

.status-row-icon {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.status-row-icon.status-ok      { background: var(--success); box-shadow: 0 0 12px rgba(52, 211, 153, 0.55); }
.status-row-icon.status-err     { background: var(--danger); box-shadow: 0 0 12px rgba(248, 113, 113, 0.55); }
.status-row-icon.status-unknown { background: var(--text-lo); }

.status-row-info { flex: 1; min-width: 0; }
.status-row-name {
    font-weight: 600;
    color: var(--text-hi);
    font-size: 0.96rem;
}
.status-row-sub {
    font-size: 0.8rem;
    margin-top: 2px;
    text-transform: capitalize;
}
.status-row-sub.status-ok      { color: var(--success); }
.status-row-sub.status-err     { color: var(--danger); }
.status-row-sub.status-unknown { color: var(--text-lo); }

.status-row-pill {
    flex: none;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 5px 12px;
    border-radius: 999px;
    text-transform: uppercase;
}
.status-row-pill.status-ok      { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.status-row-pill.status-err     { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.status-row-pill.status-unknown { background: rgba(184, 176, 204, 0.15); color: var(--text-lo); }

@media (max-width: 480px) {
    .status-row-pill { display: none; }
    .status-hero-title { font-size: 1.5rem; }
}

footer {
    text-align: center;
    padding: 18px;
    color: var(--text-lo);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}
footer a { color: var(--purple-2); text-decoration: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35); }
    50%      { box-shadow: 0 10px 32px rgba(139, 92, 246, 0.65); }
}

@media (max-width: 480px) {
    .site-header { padding: 14px 16px; }
    .brand span { font-size: 1rem; }
    .card { padding: 28px 20px; border-radius: 14px; }
    h1 { font-size: 1.3rem; }
    .profile img.avatar { width: 80px; height: 80px; }
    .hero h1 { font-size: 1.5rem; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}