:root {
    --bg: #05070f;
    --bg2: #0f1523;
    --card: #12192b;
    --card-edge: rgba(255, 255, 255, 0.08);
    --muted: #9bb0c9;
    --text: #e7eef8;
    --accent: #5ac8ff;
    --accent-strong: #46a1ff;
    --danger: #ff5c8a;
}

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

html, body {
    height: 100%;
}

body {
    margin: 0;
    font: 16px/1.55 Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(90, 200, 255, 0.08), transparent 45%),
        linear-gradient(180deg, var(--bg), var(--bg2));
    color: var(--text);
    overflow-x: hidden;
}

body::selection {
    background: rgba(90, 200, 255, 0.3);
}

.page-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(6px);
    background: linear-gradient(180deg, rgba(6, 8, 17, 0.8), rgba(6, 8, 17, 0.5));
}

.cosmos {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 30% 20%, rgba(56, 99, 195, 0.35), transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(90, 200, 255, 0.2), transparent 50%);
    overflow: hidden;
    pointer-events: none;
}

.stars {
    position: absolute;
    inset: -50%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px);
    background-size: 140px 140px;
    animation: drift 120s linear infinite;
    opacity: 0.4;
}

.layer-two {
    background-size: 200px 200px;
    animation-duration: 200s;
    opacity: 0.6;
}

.meteor-belt {
    position: absolute;
    inset: 0;
}

.meteor {
    position: absolute;
    width: 2px;
    height: 120px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), transparent);
    top: -20%;
    left: 10%;
    transform: rotate(60deg);
    opacity: 0.8;
    animation: meteor 18s linear infinite;
}

.meteor:nth-child(2) {
    left: 60%;
    animation-delay: 5s;
    opacity: 0.6;
}

.meteor:nth-child(3) {
    left: 80%;
    animation-delay: 10s;
    opacity: 0.75;
}

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1160px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px 12px;
    position: relative;
    z-index: 2;
}

.site-footer {
    padding-top: 12px;
    padding-bottom: 32px;
    margin-top: auto;
    opacity: 0.85;
}

.wrap {
    flex: 1;
    max-width: 1160px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 28px 48px;
    position: relative;
    z-index: 1;
}

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

.brand strong {
    display: block;
    font-size: 18px;
    letter-spacing: 0.4px;
}

.eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--muted);
}

.top-links {
    display: flex;
    gap: 10px;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.btn-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(90, 200, 255, 0.35), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-link:hover {
    border-color: rgba(90, 200, 255, 0.5);
    transform: translateY(-1px);
}

.btn-link:hover::after {
    opacity: 1;
}

.hero {
    padding: 40px 0 10px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 54px);
    margin: 0.3em 0 0.2em;
    line-height: 1.1;
}

.hero .lead {
    max-width: 640px;
    margin-bottom: 24px;
    color: var(--muted);
}

.muted {
    color: var(--muted);
    margin-top: 0;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cta {
    text-decoration: none;
    padding: 14px 24px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-weight: 600;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.cta.primary {
    background: linear-gradient(120deg, #43a6ff, #84d8ff);
    color: #071626;
}

.cta.ghost {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

.cta:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: 22px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    min-height: 240px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(90, 200, 255, 0.2), transparent 45%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(90, 200, 255, 0.4);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.45);
}

.card:hover::before {
    opacity: 1;
}

.card .badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card .icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(90, 200, 255, 0.15);
    margin-bottom: 16px;
    font-size: 26px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.card p {
    margin: 0 0 20px;
    color: var(--muted);
}

.card .cta {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.card .cta:hover {
    background: rgba(255, 255, 255, 0.18);
}

.card .thumb {
    position: absolute;
    inset: auto auto 12px 12px;
    width: 120px;
    opacity: 0.25;
    pointer-events: none;
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
}

@keyframes drift {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-500px, 500px, 0);
    }
}

@keyframes meteor {
    from {
        transform: translate3d(0, 0, 0) rotate(60deg);
        opacity: 1;
    }

    to {
        transform: translate3d(-1200px, 900px, 0) rotate(60deg);
        opacity: 0;
    }
}

/* Admin panel */
body.admin {
    background: linear-gradient(160deg, var(--bg), var(--bg2));
}

body.admin .page-shell {
    background: transparent;
}

.admin-main {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 28px 60px;
}

.panel-box {
    background: rgba(18, 25, 43, 0.85);
    border: 1px solid var(--card-edge);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
}

.panel-box h2 {
    margin-top: 0;
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--muted);
}

input,
textarea,
select {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(6, 8, 17, 0.6);
    color: var(--text);
    padding: 12px;
    font: inherit;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    font: inherit;
}

.btn {
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn.primary {
    background: linear-gradient(120deg, #43a6ff, #84d8ff);
    color: #071626;
}

.btn.danger {
    background: var(--danger);
    color: #fff;
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

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

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

.card-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 11, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 18px;
}

.card-list-item h3 {
    margin: 0;
    font-size: 16px;
}

.card-list-item small {
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 10px;
}

.header-actions {
    justify-content: space-between;
    align-items: center;
}

.header-actions .button-group {
    display: flex;
    gap: 10px;
}

.form-grid .actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.password-reminder {
    justify-content: flex-end;
    margin-top: 8px;
}

.btn.tertiary {
    background: transparent;
    color: var(--accent);
    border: 1px solid transparent;
    padding-left: 0;
    padding-right: 0;
}

.btn.tertiary:hover {
    color: var(--accent-strong);
}

.status-pill {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hidden {
    display: none !important;
}

.notice {
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(90, 200, 255, 0.15);
    border: 1px solid rgba(90, 200, 255, 0.4);
    color: var(--text);
    margin-bottom: 16px;
}

.error {
    background: rgba(255, 92, 138, 0.2);
    border-color: rgba(255, 92, 138, 0.5);
}

.password-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(5, 7, 15, 0.8);
    z-index: 99;
}

.password-modal .panel-box {
    max-width: 420px;
    width: 90%;
}

.password-modal .actions {
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .site-header,
    .site-footer,
    .wrap {
        padding-left: 18px;
        padding-right: 18px;
    }

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

    .grid {
        grid-template-columns: 1fr;
    }

    .card {
        min-height: 220px;
    }

    .card .thumb {
        width: 90px;
    }
}

@media (max-width: 1024px) and (min-width: 641px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
