/* LoveApp -- soft pink theme
   Display face: Fredoka (rounded, warm -- brand/headings)
   Body face: system sans-serif stack (readable, quiet)
*/

:root {
  --pink-bg: #ffe3ee;
  --pink-bg-deep: #ffd0e3;
  --pink-primary: #ec4899;
  --pink-primary-dark: #c2266e;
  --pink-card: #fff5f9;
  --heart-red: #e11d48;
  --heart-red-soft: #f43f5e;
  --plum-text: #4a1030;
  --ink: #1b0e14;
  --white: #ffffff;
  --danger: #d92d20;
  --info: #2563eb;

  --font-display: "Fredoka", "Segoe UI Rounded", "Comic Sans MS", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;

  --radius-lg: 20px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--plum-text);
  background-color: var(--pink-bg);
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.5em;
}

/* Sticker-style text: white fill, black outline. Used for headings that
   sit on colorful/patterned backgrounds where plain dark text would
   disappear or feel flat. */
.text-outline {
  color: var(--white);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px -2px 0 var(--ink), 0 3px 6px rgba(0, 0, 0, 0.25);
}

a {
  color: var(--pink-primary-dark);
}

/* ---------- Header ---------- */

.site-header {
  background: var(--pink-primary);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(194, 38, 110, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--white);
  font-size: 1.4rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.02em;
}

.brand-heart {
  color: var(--heart-red);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.nav-greeting {
  color: var(--white);
  font-weight: 600;
  margin-right: 0.25rem;
}

.btn {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.1rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

/* Header buttons sit on the solid pink bar */
.btn-header {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-header:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
}

.btn-header:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-logout {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-primary {
  background: var(--pink-primary);
  color: var(--white);
  border-color: var(--pink-primary-dark);
  width: 100%;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  font-size: 1rem;
}

.btn-primary:hover {
  background: var(--pink-primary-dark);
}

/* ---------- Flash messages ---------- */

.flashes {
  list-style: none;
  margin: 0.75rem auto 0;
  padding: 0;
  width: min(90%, 420px);
}

.flashes li {
  padding: 0.6rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
}

.flash-danger {
  background: #ffe0e0;
  color: var(--danger);
  border: 1px solid #ffb3b3;
}

.flash-info {
  background: #e3edff;
  color: var(--info);
  border: 1px solid #b8d0ff;
}

/* ---------- Main / generic pages ---------- */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.5rem;
}

.page {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

/* ---------- Login page ---------- */

body.login-page {
  background-color: var(--pink-bg-deep);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23e11d48'%3E%3Cpath transform='translate(14,10) rotate(-8) scale(1.3)' d='M12 21C12 21 2 14 2 7.5C2 4 4.5 1.5 8 1.5C10 1.5 12 3 12 3C12 3 14 1.5 16 1.5C19.5 1.5 22 4 22 7.5C22 14 12 21 12 21Z'/%3E%3Cpath transform='translate(68,58) rotate(12) scale(1.05)' fill-opacity='0.8' d='M12 21C12 21 2 14 2 7.5C2 4 4.5 1.5 8 1.5C10 1.5 12 3 12 3C12 3 14 1.5 16 1.5C19.5 1.5 22 4 22 7.5C22 14 12 21 12 21Z'/%3E%3Cpath transform='translate(-6,66) rotate(-14) scale(0.85)' fill-opacity='0.65' d='M12 21C12 21 2 14 2 7.5C2 4 4.5 1.5 8 1.5C10 1.5 12 3 12 3C12 3 14 1.5 16 1.5C19.5 1.5 22 4 22 7.5C22 14 12 21 12 21Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 120px 120px;
}

.login-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.login-panel {
  flex: 0 0 min(420px, 42vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-hero {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-hero h1 {
  font-size: 2.6rem;
  margin-bottom: 0.15em;
}

.login-hero p {
  color: var(--white);
  font-weight: 600;
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px -1px 0 var(--ink);
  margin: 0;
}

.login-card {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 16px 40px rgba(94, 15, 51, 0.28);
  border: 1px solid rgba(225, 29, 72, 0.15);
}

.field {
  text-align: left;
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--plum-text);
}

.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 2px solid var(--pink-bg-deep);
  background: var(--white);
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--plum-text);
}

.field input:focus {
  outline: none;
  border-color: var(--pink-primary);
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.field-checkbox label {
  margin: 0;
  font-weight: 500;
}

.error {
  display: block;
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  font-weight: 600;
}

.login-pictures {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.login-pictures img {
  height: 250px;
  width: 250px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(94, 15, 51, 0.2);
  border: 3px solid var(--white);
}

/* ---------- Complaints page ---------- */

.page-wide {
  max-width: 760px;
  text-align: left;
}

.page-wide h1 {
  text-align: center;
}

.tabs {
  display: flex;
  flex-direction: column;
}

.tab-input {
  display: none;
}

.tab-labels {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--pink-bg-deep);
  margin-bottom: 1.25rem;
}

.tab-label {
  cursor: pointer;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--plum-text);
  opacity: 0.6;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.tab-label:hover {
  opacity: 0.85;
}

.tab-panel {
  display: none;
}

#tab-open:checked~.tab-labels label[for="tab-open"],
#tab-history:checked~.tab-labels label[for="tab-history"] {
  opacity: 1;
  border-bottom-color: var(--pink-primary);
}

#tab-open:checked~#panel-open,
#tab-history:checked~#panel-history {
  display: block;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.filter-bar label {
  font-weight: 600;
  font-size: 0.9rem;
}

.filter-bar select {
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 2px solid var(--pink-bg-deep);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--plum-text);
}

.filter-bar select:focus {
  outline: none;
  border-color: var(--pink-primary);
}

.complaint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.complaint-card {
  background: var(--pink-card);
  border: 1px solid rgba(225, 29, 72, 0.15);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.complaint-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.complaint-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.complaint-body {
  margin: 0 0 0.6rem;
  color: var(--plum-text);
}

.complaint-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.82rem;
  color: var(--plum-text);
  opacity: 0.75;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-status-open {
  background: #ffe0e0;
  color: var(--danger);
}

.badge-status-acknowledged {
  background: #fff3cd;
  color: #8a6d00;
}

.badge-status-resolved {
  background: #dcfce7;
  color: #15803d;
}

.empty-state {
  text-align: center;
  opacity: 0.7;
  padding: 1.5rem 0;
}

/* ---------- Add Complaint modal ---------- */

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-header-row h1 {
  margin: 0;
}

.modal-toggle {
  display: none;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-toggle:checked+.modal-overlay {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 14, 20, 0.45);
  cursor: pointer;
}

.modal-card {
  position: relative;
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(94, 15, 51, 0.35);
  border: 1px solid rgba(225, 29, 72, 0.15);
}

.modal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-card-head h2 {
  margin: 0;
}

.modal-close {
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--plum-text);
  opacity: 0.6;
  padding: 0.15rem 0.4rem;
}

.modal-close:hover {
  opacity: 1;
}

.modal-card form .field input[type="text"],
.modal-card form .field textarea,
.modal-card form .field select,
.modal-card form .field input[type="number"],
.modal-card form .field input[type="datetime-local"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 2px solid var(--pink-bg-deep);
  background: var(--white);
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--plum-text);
}

.modal-card form .field textarea {
  resize: vertical;
}

.modal-card form .field input:focus,
.modal-card form .field textarea:focus,
.modal-card form .field select:focus {
  outline: none;
  border-color: var(--pink-primary);
}

.modal-card form .btn-primary {
  width: auto;
  margin-top: 0.25rem;
}

/* ---------- Complaint status/delete controls ---------- */

.complaint-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(225, 29, 72, 0.15);
}

.status-update-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-update-form label {
  font-size: 0.82rem;
  font-weight: 600;
}

.status-update-form select {
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: 2px solid var(--pink-bg-deep);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--plum-text);
}

.status-update-form select:focus {
  outline: none;
  border-color: var(--pink-primary);
}

.btn-delete {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
  font-size: 0.82rem;
  padding: 0.35rem 0.8rem;
}

.btn-delete:hover {
  background: #ffe0e0;
}

/* ---------- Calendar page ---------- */

.field-hint {
  display: block;
  font-size: 0.78rem;
  opacity: 0.65;
  margin-top: 0.25rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.calendar-nav-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
}

.calendar-today-link {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pink-primary-dark);
  text-decoration: none;
}

.calendar-today-link:hover {
  text-decoration: underline;
}

.calendar-grid {
  border: 1px solid rgba(225, 29, 72, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--pink-card);
}

.calendar-weekdays,
.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekday {
  padding: 0.5rem 0.4rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pink-primary-dark);
  background: var(--pink-bg-deep);
}

.calendar-day {
  min-height: 92px;
  padding: 0.4rem;
  border-top: 1px solid rgba(225, 29, 72, 0.12);
  border-left: 1px solid rgba(225, 29, 72, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calendar-week .calendar-day:first-child {
  border-left: none;
}

.calendar-day-number {
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.8;
}

.calendar-day.other-month {
  background: rgba(255, 255, 255, 0.4);
}

.calendar-day.other-month .calendar-day-number {
  opacity: 0.35;
}

.calendar-day.today .calendar-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.3rem;
  border-radius: var(--radius-pill);
  background: var(--pink-primary);
  color: var(--white);
  opacity: 1;
}

.calendar-day-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.event-pill {
  width: 100%;
}

.event-pill-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  padding: 0.2rem 0.4rem;
  border: none;
  border-radius: 8px;
  background: var(--pink-bg-deep);
  color: var(--plum-text);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
}

.event-pill-main:hover {
  background: var(--pink-primary);
  color: var(--white);
}

.event-pill-time {
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.8;
}

.event-pill-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.modal-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-header {
  background: rgba(255, 255, 255, 0.18);
  color: var(--black);
  border-color: rgba(255, 255, 255, 0.219);
}

.btn-header:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.199);
}