:root {
    --bg-dark: #050811;
    --bg-card: rgba(8, 12, 25, 0.95);
    --accent-red: #ff4b5c;
    --accent-green: #00ffb3;
    --accent-gold: #ffd166;
    --text-main: #f7f7ff;
    --text-muted: #9fa6c5;
    --danger: #ff3366;
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.9);
}

/* RESET */

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

html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background: radial-gradient(circle at top, #1b1e3f 0, #050811 55%, #000 100%);
    overflow-x: hidden;
}

/* Snow background */

.snow-bg {
    position: relative;
}

.snow, .snow2, .snow3 {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20px 20px, #ffffffaa, transparent),
        radial-gradient(3px 3px at 40px 60px, #ffffffaa, transparent),
        radial-gradient(2px 2px at 130px 80px, #ffffffaa, transparent),
        radial-gradient(3px 3px at 90px 120px, #ffffffaa, transparent),
        radial-gradient(2px 2px at 200px 160px, #ffffffaa, transparent);
    background-repeat: repeat;
    opacity: 0.6;
    z-index: 0;
    animation: snow 20s linear infinite;
}

.snow2 {
    animation-duration: 30s;
    opacity: 0.4;
}

.snow3 {
    animation-duration: 40s;
    opacity: 0.2;
}

@keyframes snow {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    to   { background-position: 0 800px, 0 1000px, 0 900px, 0 1100px, 0 950px; }
}

/* LAYOUT - MOBILE FIRST */

.center-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    width: 100%;
    max-width: 380px;
    border-radius: 24px;
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-strong);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 0% 0%, rgba(0, 255, 179, 0.17), transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(255, 75, 92, 0.17), transparent 55%);
    opacity: 0.9;
    z-index: -2;
}

.card.glass {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.4);
    backdrop-filter: blur(22px);
}

.login-card {
    max-width: 380px;
}

.big-card {
    max-width: 920px;
}

/* HEADER */

.card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.card-header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-red), var(--accent-green));
    -webkit-background-clip: text;
    color: transparent;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ALERTS */

.alert {
    border-radius: 999px;
    padding: 0.6rem 1rem;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.7);
    color: #fecaca;
}

.alert-info {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.7);
    color: #e0f2fe;
}

/* FORM */

.form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    background: rgba(15, 23, 42, 0.96);
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    padding: 0.7rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.06s ease;
}

input::placeholder {
    color: rgba(148, 163, 184, 0.85);
}

input:focus,
select:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.55);
    transform: translateY(-1px);
}

/* BUTTONS */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    padding: 0.7rem 1.3rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    gap: 0.45rem;
    transition: transform 0.1s ease, box-shadow 0.12s ease, filter 0.18s ease;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-gold));
    color: #020617;
    box-shadow: 0 10px 30px rgba(248, 113, 113, 0.5);
}

.secondary-btn {
    background: linear-gradient(135deg, #22c55e, #a3e635);
    color: #052e16;
    box-shadow: 0 10px 26px rgba(74, 222, 128, 0.5);
}

.danger-btn {
    background: linear-gradient(135deg, #ef4444, #fb7185);
    color: #f9fafb;
    box-shadow: 0 10px 30px rgba(248, 113, 113, 0.6);
}

.glow-btn {
    position: relative;
}

.glow-btn::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    border: 1px solid rgba(253, 224, 71, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

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

.btn:hover {
    transform: translateY(-1px) scale(1.01);
    filter: brightness(1.03);
}

.full-width {
    width: 100%;
}

.small-btn {
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
}

/* FOOTER TEXT */

.footer-text {
    margin-top: 1.2rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.link {
    color: var(--accent-green);
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* TOP BAR */

.top-bar {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.85));
    border-bottom: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.95);
}

.logo {
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--accent-gold);
}

.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* MAIN CONTENT */

.main-content {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 70px);
    padding: 1.5rem 1rem 2.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.lead {
    margin-top: 0.4rem;
    margin-bottom: 1.4rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* USER GIF */

.user-gif-wrapper {
    margin-top: 1.2rem;
    display: flex;
    justify-content: center;
}

.user-gif {
    max-width: 100%;
    max-height: 340px;
    border-radius: 22px;
    border: 2px solid rgba(251, 191, 36, 0.85);
    box-shadow: 0 0 50px rgba(250, 204, 21, 0.5);
}

/* TABLES (ADMIN) */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    min-width: 640px;
}

.table th,
.table td {
    padding: 0.45rem 0.45rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
    vertical-align: middle;
}

.table th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.table input[type="text"],
.table input[type="email"],
.table input[type="password"],
.table select {
    width: 100%;
    font-size: 0.78rem;
    padding: 0.4rem 0.6rem;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.new-row input {
    background: rgba(15, 23, 42, 0.9);
}

/* ADMIN TABS */

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    padding-bottom: 0.35rem;
}

.tab {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: 0.15s ease;
}

.tab:hover {
    color: var(--accent-green);
}

.tab.active {
    color: #020617;
    background: linear-gradient(120deg, var(--accent-green), var(--accent-gold));
    border-color: transparent;
}

/* RESPONSIVE DESKTOP ENHANCEMENTS */

@media (min-width: 768px) {
    .center-wrapper {
        padding: 2rem;
    }

    .card {
        padding: 2rem 2.3rem;
    }

    .card-header h1 {
        font-size: 1.9rem;
    }

    .top-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-inline: 2.5rem;
    }

    .main-content {
        padding: 2.5rem 2.5rem 3rem;
    }

    .login-card {
        max-width: 420px;
    }

    .user-gif {
        max-height: 420px;
    }
}

@media (min-width: 1024px) {
    .big-card {
        padding: 2.3rem 2.6rem;
    }
}
