/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --primary-color: #6C5CE7;
    --primary-hover: #5a4ad1;
    --bg-gradient-start: #0f0c29;
    --bg-gradient-mid: #302b63;
    --bg-gradient-end: #24243e;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --text-muted: #cbd5e1;
    --input-bg: rgba(255, 255, 255, 0.05);
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Deep Dark Gradient */
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

body {
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100dvh;
    /* For mobile browsers */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 15px;
    /* Reduced padding */
}

img.logo {
    width: 70px;
    margin-bottom: 15px;
}

h1,
h2,
h3 {
    margin-bottom: 0.8rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    /* Stronger shadow for contrast */
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--primary-color);
}

/* Glassmorphism Container */
.container {
    /* Darker Glass Effect */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    /* Reduced from 40px */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    /* Slightly narrower */
    text-align: center;
    animation: fadeIn 0.8s ease-in-out;
}

.container-wide {
    max-width: 1000px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms */
.form-group {
    margin-bottom: 15px;
    /* Reduced from 20px */
    text-align: left;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.3);
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

.btn-danger {
    background: var(--danger-color);
    width: auto;
    /* Allow auto width for delete button */
}

.btn-danger:hover {
    background: #c0392b;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    margin-top: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 12px 15px;
    /* Compact table */
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(108, 92, 231, 0.2);
    color: var(--primary-color);
    font-weight: 600;
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Utility */
.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 0.8rem;
}

.error-msg {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 5px;
}

.success-msg {
    color: var(--success-color);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Links */
.link {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 15px;
    display: block;
}

.link a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Navigation */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

/* Responsive Fixes */
@media (max-height: 700px) {
    .container {
        padding: 20px;
        margin-top: 0;
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    input {
        padding: 8px 12px;
    }

    .btn {
        padding: 10px;
    }
}