:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --success: #10b981;
    --success-dim: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
}

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

body {
    /* Moderne 'mørk modus' gradient */
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-dark), #09090b);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- GLASSMORPHISM SYSTEM --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* --- INNLOGGING --- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 1rem;
}

.login-card {
    max-width: 420px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.login-card h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    background: linear-gradient(135deg, #a78bfa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.input-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--success);
    font-size: 0.8rem;
    line-height: 1.4;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* --- DASHBOARD / HOVEDSIDEN --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #34d399, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-user {
    font-size: 0.95rem;
}

.btn-logout {
    color: var(--danger);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    transition: 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.dashboard {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    flex-grow: 1;
}

.list-container h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.add-item-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    background: rgba(0,0,0,0.2);
    padding: 0.5rem;
    border-radius: 18px;
    border: 1px solid var(--border-glass);
}

.add-item-form input {
    flex-grow: 1;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.add-item-form input:focus {
    outline: none;
}

.add-item-form button {
    width: 70px;
    border-radius: 14px;
    font-size: 2rem;
    flex-shrink: 0;
}

.list-sections h3 {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
    margin-top: 1rem;
}

.item-list {
    list-style: none;
    margin-bottom: 2rem;
}

.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
}

.item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.item-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.item-checkbox {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.item-checkbox:hover {
    border-color: var(--success);
    background: var(--success-dim);
    transform: scale(1.1);
}

.item.bought {
    opacity: 0.7;
    background: transparent;
    border-color: transparent;
}

.item.bought .item-checkbox {
    background: var(--success);
    border-color: var(--success);
}

.item.bought .item-checkbox::after {
    content: '✓';
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
}

.item-info {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-size: 1.3rem;
    font-weight: 600;
    transition: color 0.3s;
}

.item.bought .item-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.item-meta span {
    color: #cbd5e1;
    font-weight: 600;
}

/* Animasjoner */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Mobil layout */
@media (max-width: 600px) {
    .glass-card { padding: 1.5rem; border-radius: 20px;}
    .add-item-form { border-radius: 12px; }
    .nav-user { display: none; /* Skjul tekst på liten skjerm for plassen sin skyld, men la logg ut stå */ }
    .navbar { padding: 1rem; }
}
