/* ── Auth-pill ──────────────────────────────────────────────────────────────── */
#auth-pill {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
}


.fav-heart-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
  filter: drop-shadow(0 1px 5px rgba(0,0,0,0.70));
  transition: color 0.15s, transform 0.15s;
  margin-left: auto;
  flex-shrink: 0;
}
#hero-fav-btn.fav-heart-btn {
  margin-left: -1.2px;
  font-size: 1.39rem;
}
.fav-heart-btn.active { color: #ffffff; }
#hero-fav-btn.fav-heart-btn.active { color: #ffffff; }
.fav-heart-btn:hover { transform: scale(1.2); }

/* ── Auth-modal ─────────────────────────────────────────────────────────────── */
#auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#auth-modal.hidden { display: none; }
#auth-step-done.hidden { display: none; }

#auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 30, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#auth-modal-box {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
  padding: 32px 36px;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Wizard ──────────────────────────────────────────────────────────────────── */
#auth-wizard-viewport {
  overflow: hidden;
  transition: height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

#auth-wizard-track {
  display: flex;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

#auth-wizard-track[data-step="0"] { transform: translateX(0); }
#auth-wizard-track[data-step="1"] { transform: translateX(-100%); }

.auth-wizard-step {
  min-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-back-btn {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  font-size: 0.80rem;
  font-family: inherit;
  text-align: left;
  transition: color 0.15s;
  margin-bottom: -2px;
}
.auth-back-btn:hover { color: rgba(255, 255, 255, 0.80); }

#auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.40);
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
#auth-modal-close:hover {
  color: rgba(255, 255, 255, 0.80);
  background: rgba(255, 255, 255, 0.08);
}

#auth-modal-box h3 {
  margin: 0 0 2px;
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.01em;
}

#auth-modal-box p {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
  line-height: 1.45;
}

#auth-email-input,
#auth-otp-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.92);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
#auth-email-input::placeholder,
#auth-otp-input::placeholder {
  color: rgba(255, 255, 255, 0.30);
}
#auth-email-input:focus,
#auth-otp-input:focus {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}

/* OTP-input: larger, centred numerals */
#auth-otp-input {
  font-size: 1.5rem;
  letter-spacing: 0.35em;
  text-align: center;
  padding: 13px 14px;
}

#auth-send-otp-btn,
#auth-verify-otp-btn,
#auth-close-done-btn {
  width: 100%;
  padding: 11px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  letter-spacing: 0.01em;
}
#auth-send-otp-btn:hover,
#auth-verify-otp-btn:hover,
#auth-close-done-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.30);
}
#auth-send-otp-btn:disabled,
#auth-verify-otp-btn:disabled {
  opacity: 0.40;
  cursor: default;
}

/* Verify button hidden – auto-submit via input listener */
#auth-verify-otp-btn {
  display: none;
}

/* Hint text under OTP input */
.auth-otp-hint {
  font-size: 0.80rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  margin-top: -4px;
}

.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.50);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  text-decoration: none;
  margin-top: 2px;
  display: inline-block;
  transition: color 0.15s;
}
.auth-link-btn:hover {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: underline;
}

.auth-error {
  color: rgba(255, 100, 100, 0.90);
  font-size: 0.83rem;
  margin-top: 2px;
  padding: 8px 12px;
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.25);
  border-radius: 8px;
}
.auth-error.hidden { display: none; }

/* ── Favorit-panel ──────────────────────────────────────────────────────────── */
.fav-panel {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: min(400px, 100vw);
  background: rgba(22, 28, 55, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.35);
  z-index: 5000;
  overflow-y: auto;
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.fav-panel.hidden { transform: translateX(100%); }

.fav-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4999;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.fav-panel-backdrop.hidden { display: none; }

.fav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: rgba(22, 28, 55, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1;
}
.fav-panel-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}
.fav-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fav-ical-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.70);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.fav-ical-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.90);
}

#fav-panel-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.40);
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
#fav-panel-close:hover {
  color: rgba(255, 255, 255, 0.80);
  background: rgba(255, 255, 255, 0.08);
}

#fav-empty {
  padding: 24px 16px;
  color: rgba(255, 255, 255, 0.40);
  font-size: 0.9rem;
  text-align: center;
}
#fav-empty.hidden { display: none; }

.fav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.fav-item-body {
  flex: 1;
  min-width: 0;
}
.fav-item-title a {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.fav-item-title a:hover { text-decoration: underline; }
.fav-item-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.fav-ics-btn,
.fav-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.38);
  transition: background 0.15s, color 0.15s;
}
.fav-ics-btn:hover,
.fav-remove-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.80);
}

.fav-panel-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fav-logout-btn {
  width: 100%;
  padding: 9px 12px;
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.22);
  border-radius: 8px;
  color: rgba(255, 100, 100, 0.75);
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fav-logout-btn:hover {
  background: rgba(231, 76, 60, 0.18);
  border-color: rgba(231, 76, 60, 0.40);
  color: rgba(255, 120, 120, 0.95);
}

/* ── Datumväljar-modal ──────────────────────────────────────────────────────── */
.date-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(10, 12, 30, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.date-picker-modal {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
  padding: 28px 28px 24px;
  width: min(440px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.date-picker-modal h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.01em;
}

.date-picker-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.50);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-picker-dates {
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 -4px;
  padding: 0 4px;
  /* Thin scrollbar to match the dark glassmorphism aesthetic */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.date-picker-dates::-webkit-scrollbar { width: 4px; }
.date-picker-dates::-webkit-scrollbar-track { background: transparent; }
.date-picker-dates::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}

/* ── Dag-rubrik (trädstruktur) ─── */
.date-picker-day-header {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: capitalize;
  color: rgba(255, 255, 255, 0.40);
  padding: 10px 10px 4px;
  /* Extra top-spacing when not the first header */
  margin-top: 4px;
}
.date-picker-day-header:first-child {
  margin-top: 0;
  padding-top: 4px;
}

/* ── Tid-rad (indenterad under dag-rubrik) ─── */
.date-picker-date-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
}
/* Tidsrader indenteras ytterligare för trädkänslan */
.date-picker-date-item--time {
  padding-left: 24px;
}
.date-picker-date-item:hover { background: rgba(255, 255, 255, 0.07); }
.date-picker-date-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #e74c3c;
  cursor: pointer;
}

/* ── Tomt-tillstånd (inga kommande tillfällen) ─── */
.date-picker-empty {
  margin: 8px 0 4px;
  padding: 20px 10px;
  text-align: center;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.38);
  font-style: italic;
}

.date-picker-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.date-picker-cancel-btn {
  padding: 9px 16px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.date-picker-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.80);
}

.date-picker-confirm-btn {
  padding: 9px 20px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.date-picker-confirm-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.30);
}
.date-picker-confirm-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

/* Mobil: bottom sheet */
@media (max-width: 768px) {
  .fav-panel {
    width: 100vw;
    height: 70vh;
    top: auto;
    bottom: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    transform: translateY(0);
  }
  .fav-panel.hidden { transform: translateY(100%); }

  #auth-modal-box {
    padding: 24px 20px;
  }

  .date-picker-modal {
    padding: 24px 20px 20px;
  }
  .date-picker-actions {
    flex-direction: column-reverse;
  }
  .date-picker-cancel-btn,
  .date-picker-confirm-btn {
    width: 100%;
    text-align: center;
  }
}
