:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --card: rgba(255, 255, 255, 0.88);
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);
  --brand: #0f4c81;
  --accent: #f59e0b;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --font-sans: "Manrope", sans-serif;
  --font-display: "Fraunces", serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  min-height: 100vh;
  background: url('baggrund.png') center center / cover fixed no-repeat;
  color: var(--text);
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px;
}

.hero {
  min-height: auto;
  padding: 24px 0 8px;
}

.hero-copy {
  margin-top: 32px;
  max-width: 720px;
}

.hero-kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.hero-title {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  font-family: var(--font-display);
  font-weight: 500;
}

.content {
  padding-top: 16px;
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topbar-menu {
  position: relative;
  margin: 0;
}

.topbar-menu summary {
  list-style: none;
}

.topbar-menu summary::-webkit-details-marker {
  display: none;
}

.menu-button {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.menu-button img {
  width: 22px;
  height: 22px;
}

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  min-width: 170px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}

.menu-panel a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}


.login-link {
  font-weight: 500;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.card-title {
  margin-top: 0;
}

.card-spaced {
  margin-top: 16px;
}

.calendar-embed {
  margin-top: 12px;
}

.calendar-legend {
  margin-top: 12px;
}

.calendar-note {
  margin-top: 16px;
}

.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.form-reset {
  margin: 0;
}

.list-reset {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.mt-4 {
  margin-top: 4px;
}

.debug-box {
  background: #0f172a0d;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  overflow: auto;
  max-height: 260px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  background: var(--legend-color, var(--brand));
}

.guide-post {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.guide-post > h3,
.guide-post > p {
  margin: 0;
}

.guide-header {
  display: grid;
  gap: 12px;
}

.guide-meta {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
}

.guide-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
}

.guide-lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.guide-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 900px) {
  .guide-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.guide-block h3 {
  margin-top: 0;
}

.guide-image {
  margin-top: 12px;
  height: 180px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

.guide-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.guide-wide {
  margin-top: 16px;
}

.guide-image-wide {
  height: 220px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 860px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

label { display: block; font-weight: 500; margin: 10px 0 6px; }
input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: rgba(255, 255, 255, 0.85);
}
textarea { min-height: 90px; resize: vertical; }

.otp-group {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  max-width: 420px;
}

.otp-digit {
  width: 100%;
  height: 58px;
  padding: 0;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  border-radius: 14px;
  letter-spacing: 0;
}

.otp-digit:focus {
  outline: none;
  border-color: rgba(15, 76, 129, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.14);
}

.otp-hint {
  margin-top: 10px;
}

button {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 500;
  cursor: pointer;
}
button.secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.hint { color: var(--muted); font-size: 0.95rem; }
.flash {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* FullCalendar theme */
.fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: rgba(255, 255, 255, 0.65);
  --fc-today-bg-color: rgba(245, 158, 11, 0.12);
  font-family: var(--font-sans);
}

.fc .fc-toolbar-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
}

.fc .fc-button {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  padding: 6px 12px;
  text-transform: none;
  font-weight: 500;
  box-shadow: none;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
}

.fc-theme-standard .fc-scrollgrid,
.fc-theme-standard td,
.fc-theme-standard th {
  border-color: var(--border);
}

.fc .fc-list {
  border: 0;
}

.fc .fc-list-table {
  border-collapse: separate;
  border-spacing: 0 2px;
}

.fc .fc-list-day-cushion {
  background: rgba(255, 255, 255, 0.8);
  border: 0;
  border-radius: 12px;
  margin: 4px 0;
  padding: 6px 10px;
  font-family: var(--font-display);
}

.fc .fc-list-event {
  border: 0;
  background: transparent;
}

.fc .fc-day-events tr td {
  background: rgba(255, 255, 255, 0.75);
  border: 0;
}


.fc .fc-list-event-dot {
  border-color: var(--brand);
}

.fc .fc-list-event-time {
  color: var(--muted);
  font-weight: 500;
}

.fc .fc-list-event-title {
  font-weight: 500;
}

/* FullCalendar overrides */
.fc .fc-list-table td,
.fc .fc-list-table th {
  border: 0;
}

@media (max-width: 760px) {
  .container {
    padding: 16px 10px;
  }

  .card {
    padding: 12px;
    border-radius: 12px;
  }

  .calendar-embed {
    margin-top: 8px;
    max-height: none;
    overflow: visible;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .fc .fc-toolbar-title {
    font-size: 1.2rem;
    text-align: center;
  }

  .fc .fc-button {
    padding: 4px 8px;
    font-size: 0.82rem;
  }

  .otp-group {
    gap: 8px;
  }

  .otp-digit {
    height: 52px;
    font-size: 1.35rem;
  }

  .fc .fc-col-header-cell-cushion,
  .fc .fc-daygrid-day-number,
  .fc .fc-list-event-time,
  .fc .fc-list-event-title {
    font-size: 0.85rem;
  }
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 6px;
}

.badge-new {
  background: #dc2626;
  color: white;
}

/* Form styles */
.form-section {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
}

.form-section h3,
.form-section h4 {
  margin-top: 0;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Button variants */
.btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  transition: background 0.2s;
}

.btn:hover {
  background: rgba(255, 255, 255, 1);
}

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

.btn-primary:hover {
  background: #0a3a61;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.9rem;
}

/* Warning box */
.warning-box {
  padding: 16px;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  margin-bottom: 24px;
}

.warning-box h3 {
  margin-top: 0;
  color: #d97706;
}

.warning-box p {
  margin-bottom: 0;
}

/* Public link box */
.public-link-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 76, 129, 0.05);
}

.public-link-box h4 {
  margin-top: 0;
}

.link-copy-wrapper {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: stretch;
}

.public-link-input {
  font-family: monospace;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.95);
  flex: 1;
}

.btn-copy {
  margin-top: 0;
  padding: 10px 16px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-success-flash {
  background: #16a34a !important;
  color: white !important;
}

/* Events list */
.events-list {
  margin-top: 24px;
}

.events-list h4 {
  margin-bottom: 12px;
}

/* Danger zone */
.danger-zone {
  margin-top: 32px;
  padding: 16px;
  border: 2px solid #dc2626;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.05);
}

.danger-zone h4 {
  margin-top: 0;
  color: #dc2626;
}

/* Tabs system - kapsel/pill design */
.tabs-container {
  margin-top: 16px;
}

.tabs-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.tab-link {
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-link:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--border);
}

.tab-link.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(15, 76, 129, 0.25);
}

/* Calendar item in settings */
.calendars-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.calendar-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.calendar-info {
  flex: 1;
}

.calendar-info h5 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

.calendar-actions {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .calendar-item {
    flex-direction: column;
  }
  
  .tabs-nav {
    gap: 6px;
    padding: 6px;
  }
  
  .tab-link {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  
  .link-copy-wrapper {
    flex-direction: column;
  }
  
  .btn-copy {
    width: 100%;
  }
}
