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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #222;
  min-height: 100vh;
}

/* Auth */
.auth-box {
  max-width: 380px;
  margin: 10vh auto;
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}
.auth-box h1 { margin-bottom: 1.5rem; font-size: 1.6rem; }
.auth-box input {
  width: 100%; display: block; margin-bottom: 0.75rem;
  padding: 0.65rem 0.9rem; border: 1px solid #ddd; border-radius: 8px;
  font-size: 1rem;
}
.auth-box input:focus { outline: none; border-color: #4f8ef7; }
.auth-box button[type=submit] { width: 100%; }
.link { margin-top: 1.2rem; text-align: center; font-size: 0.9rem; color: #666; }
.link a { color: #4f8ef7; text-decoration: none; }
.error { background: #fee; color: #c00; padding: 0.6rem 0.9rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }

/* Header */
header {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
header h1 { font-size: 1.2rem; flex: 1; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.username { color: #666; font-size: 0.9rem; }
.back { text-decoration: none; color: #4f8ef7; font-size: 0.9rem; white-space: nowrap; }

/* Main */
main { max-width: 640px; margin: 0 auto; padding: 1.5rem 1rem; }

/* Inline form */
.inline-form { display: flex; gap: 0.5rem; }
.inline-form input { flex: 1; padding: 0.65rem 0.9rem; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem; }
.inline-form input:focus { outline: none; border-color: #4f8ef7; }
.inline-form select { flex: 1; padding: 0.65rem 0.9rem; border: 1px solid #ddd; border-radius: 8px; font-size: 0.95rem; }

/* Buttons */
.btn-primary {
  background: #4f8ef7; color: #fff; border: none; border-radius: 8px;
  padding: 0.65rem 1.2rem; cursor: pointer; font-size: 0.95rem; white-space: nowrap;
}
.btn-primary:hover { background: #3a7ae0; }
.btn-secondary {
  background: #eef3ff; color: #4f8ef7; border: 1px solid #c7d9ff; border-radius: 8px;
  padding: 0.65rem 1.1rem; cursor: pointer; font-size: 0.95rem;
}
.btn-secondary:hover { background: #dce9ff; }
.btn-link { background: none; border: none; color: #4f8ef7; cursor: pointer; font-size: 0.9rem; padding: 0; }
.btn-link.danger { color: #e53e3e; }
.btn-danger {
  background: none; border: 1px solid #e53e3e; color: #e53e3e; border-radius: 8px;
  padding: 0.5rem 1rem; cursor: pointer; font-size: 0.9rem;
}
.btn-danger:hover { background: #fff5f5; }

/* Listkort */
.new-list { margin-bottom: 1.5rem; }
.list-cards { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.list-card {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 10px; padding: 1rem 1.2rem;
  text-decoration: none; color: #222; box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  transition: box-shadow 0.15s;
}
.list-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.list-name { font-size: 1rem; font-weight: 500; }
.shared-badge { font-size: 0.78rem; color: #888; background: #f0f0f0; padding: 0.2rem 0.6rem; border-radius: 20px; }

/* Varer */
.add-item { margin-bottom: 1.2rem; }
.items { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.item {
  display: flex; align-items: center; gap: 0.75rem;
  background: #fff; border-radius: 10px; padding: 0.75rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.item.checked .item-name { text-decoration: line-through; color: #aaa; }
.item-name { flex: 1; font-size: 0.98rem; }
.toggle-form { display: contents; }
.delete-form { display: contents; }
.item-toggle {
  display: flex; align-items: center; gap: 0.75rem;
  flex: 1; background: none; border: none; cursor: pointer;
  text-align: left; padding: 0; min-width: 0;
}
.item-toggle:hover .checkbox { border-color: #4f8ef7; }
.checkbox {
  width: 22px; height: 22px; border: 2px solid #ccc; border-radius: 50%;
  flex-shrink: 0; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.checkbox.checked { background: #4f8ef7; border-color: #4f8ef7; }
.btn-delete {
  background: none; border: none; color: #ccc; cursor: pointer;
  font-size: 1.2rem; line-height: 1; padding: 0 0.2rem;
}
.btn-delete:hover { color: #e53e3e; }
.section-divider { font-size: 0.8rem; color: #aaa; padding: 0.5rem 0 0.2rem; letter-spacing: 0.05em; }

/* Deling */
.sharing { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #eee; }
.sharing h2 { font-size: 1rem; margin-bottom: 1rem; color: #555; }
.share-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.8rem; }
.share-list li { display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; }
.danger-zone { margin-top: 2rem; }
.empty { color: #aaa; font-size: 0.9rem; padding: 0.5rem 0; }
