/* Auth Pages */
body.auth-page {
    min-height: 100vh;
    /* Base space background + stars + blue gradient */
    background-color: #0f172a;
    background-image:
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px),
        linear-gradient(135deg, var(--primary-color) 0%, #3a56ff 100%);
    background-size: 550px 550px, 350px 350px, 250px 250px, cover;
    background-position: 0 0, 40px 60px, 130px 270px, center;
    background-attachment: fixed;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    /* Clear local background to let full-page gradient show through */
    background: transparent;
}

/* Auth form container */
.auth-form-container {
    max-width: 800px;
    width: 100%;
    margin: 2rem auto;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(159, 122, 234, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 10;
    padding: 2rem;
}

/* Auth header */
.auth-header {
    /* Keep header panel styling within the box, no edge sliver */
    background: transparent;
    color: white;
    padding: 0 0 1rem 0;
    text-align: center;
    border-bottom: none;
    margin: 0 0 1.5rem 0;
}

.auth-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Tab Styles */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 -2rem 2rem -2rem;
    padding: 0 2rem;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.auth-tab:hover {
    color: rgba(255, 255, 255, 0.9);
}

.auth-tab.active {
    color: #fff;
    border-bottom-color: var(--primary-color);
    font-weight: 600;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #4299e1;
}

/* Form Styles */
.auth-content {
    position: relative;
    min-height: 300px;
}

.form-group {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group-text {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: #a0aec0;
    background: transparent;
    border: none;
    z-index: 10;
}

.input-group input {
    padding-left: 3rem;
}

/* Compact Toggle and Label */
.form-check {
    display: inline-flex;
    align-items: center;
    margin: 0.25rem 0 0.5rem 0; /* Reduced vertical margin */
    line-height: 1;
}

/* Smaller, tighter toggle */
.form-check-input {
    width: 14px;     /* Smaller toggle */
    height: 14px;    /* Smaller toggle */
    margin: 0;
    cursor: pointer;
}

/* Compact label */
.form-check-label {
    margin-left: 0.25rem;  /* Reduced gap */
    font-size: 0.9rem;     /* Slightly smaller text */
    color: #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
    padding: 0;
    line-height: 1;
}

/* Remove any extra spacing */
.auth-form .form-check {
    margin: 0.25rem 0 0.5rem 0;
    padding: 0;
}

/* Ensure register form's terms checkbox aligns with login's remember-me */
#terms {
    margin-top: 0;
    margin-bottom: 0;
}

/* Keep terms links on same line as checkbox */
.form-check-label a {
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.text-muted {
    color: #a0aec0 !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

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

.auth-box {
    background: rgba(13, 17, 28, 0.8);
    border-radius: 10px;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.2);
    border: 1px solid rgba(0, 150, 255, 0.1);
}

.auth-box h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 2rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #a0aec0;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(26, 32, 44, 0.8);
    border: 1px solid #2d3748;
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.3);
}

.form-group small {
    display: block;
    color: #718096;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(145deg, #1e3a8a, #1e40af);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.btn-primary {
    background: #4299e1;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #3182ce;
}

.btn-outline {
    background: transparent;
    border: 1px solid #4299e1;
    color: #4299e1;
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(66, 153, 225, 0.1);
    transform: translateY(-2px);
}

.btn-outline:hover {
    background: rgba(66, 153, 225, 0.1);
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

.alert-danger {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid #f87171;
    color: #f87171;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid #48bb78;
    color: #48bb78;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    color: #a0aec0;
    font-size: 0.9rem;
}

.auth-links a {
    color: #4299e1;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: #63b3ed;
    text-decoration: underline;
}

.auth-links span {
    margin: 0 0.5rem;
    color: #4a5568;
}

/* Dashboard Styles */
.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h1 {
    color: #fff;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: #a0aec0;
    font-size: 1.1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: rgba(26, 32, 44, 0.8);
    border-radius: 10px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #2d3748;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.dashboard-card h3 {
    color: #fff;
    margin-bottom: 0.75rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
}

.dashboard-card p {
    color: #a0aec0;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Admin Dashboard */
.admin-header {
    text-align: center;
    margin-bottom: 3rem;
}

.admin-header h1 {
    color: #fff;
    margin-bottom: 0.5rem;
}

.admin-header p {
    color: #a0aec0;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(26, 32, 44, 0.8);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #2d3748;
}

.stat-card h3 {
    color: #a0aec0;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4299e1;
    margin: 1rem 0;
    font-family: 'Orbitron', sans-serif;
}

.admin-actions {
    margin-top: 3rem;
    text-align: center;
}

.admin-actions h2 {
    color: #fff;
    margin-bottom: 1.5rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    min-width: 200px;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-box {
        padding: 1.5rem;
    }
    
    .dashboard-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
}
