/* ============================================================
   FantaSposi — Design System
   A premium, wedding-themed CSS design system
   ============================================================ */

/* ─── Google Fonts Import ─── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

/* ============================================================
   1. CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
  /* ── Color Palette ── */
  --cream:              #FFF8F0;
  --rosa-cipria:        #F2C4C4;
  --rosa-cipria-light:  #F9E0E0;
  --lilla:              #D4B8E0;
  --lilla-light:        #EBD9F2;
  --verde-salvia:       #A8C5A0;
  --verde-salvia-light: #D0E5CB;
  --pesca:              #FADADD;
  --pesca-light:        #FEF0F1;
  --azzurro-polvere:    #B8D4E3;
  --text-dark:          #3D3D3D;
  --text-light:         #7A7A7A;
  --reject-soft:        #E8A0A0;
  --white:              #FFFFFF;

  /* ── Shadows ── */
  --shadow-soft:  0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-card:  0 2px 12px rgba(0, 0, 0, 0.08);

  /* ── Radii ── */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

/* ============================================================
   2. Reset & Global Styles
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* ── Subtle floral / botanical repeating SVG background ──
     Delicate line-art roses & leaves in very faint lilac       */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cdefs%3E%3Cstyle%3E.fl%7Bfill:none;stroke:rgba(210,180,220,0.08);stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round%7D%3C/style%3E%3C/defs%3E%3C!-- rose 1 --%3E%3Cpath class='fl' d='M40 60c-4-8 2-18 12-16s10 14 4 20c-6 6-16 4-16-4'/%3E%3Cpath class='fl' d='M44 56c0 0 6-2 8 4s-2 10-6 10'/%3E%3Cpath class='fl' d='M48 58c0 0 2 0 3 3s-1 5-3 5'/%3E%3C!-- stem 1 --%3E%3Cpath class='fl' d='M42 76c0 0 2 20 0 40'/%3E%3C!-- leaf 1a --%3E%3Cpath class='fl' d='M42 90c-10 4-16-2-12-8s12-2 12 0'/%3E%3Cpath class='fl' d='M42 90c0 0-8 1-10-2'/%3E%3C!-- leaf 1b --%3E%3Cpath class='fl' d='M42 100c8 6 16 2 12-4s-12 0-12 2'/%3E%3Cpath class='fl' d='M42 100c0 0 8 2 10-1'/%3E%3C!-- rose 2 --%3E%3Cpath class='fl' d='M150 20c6-6 16-4 16 4s-10 12-16 8c-6-4-6-14 0-12'/%3E%3Cpath class='fl' d='M152 24c0 0 4-2 6 2s0 8-4 8'/%3E%3Cpath class='fl' d='M154 26c0 0 1 1 1 3s-1 3-2 3'/%3E%3C!-- stem 2 --%3E%3Cpath class='fl' d='M152 36c0 0-2 16 0 34'/%3E%3C!-- leaf 2a --%3E%3Cpath class='fl' d='M152 48c8 4 14-2 10-8s-10-2-10 0'/%3E%3Cpath class='fl' d='M152 48c0 0 6 0 8-3'/%3E%3C!-- small bud --%3E%3Cpath class='fl' d='M100 150c-2-6 4-10 8-8s4 8 0 12c-4 4-8 2-8-4'/%3E%3Cpath class='fl' d='M102 148c0 0 2 0 3 2s0 4-2 4'/%3E%3C!-- stem bud --%3E%3Cpath class='fl' d='M102 158c0 0 1 10 0 22'/%3E%3C!-- leaf bud --%3E%3Cpath class='fl' d='M102 166c-6 2-10-2-8-6s8 0 8 2'/%3E%3Cpath class='fl' d='M102 166c0 0-4 0-6-2'/%3E%3C!-- scattered petals --%3E%3Cellipse class='fl' cx='170' cy='140' rx='3' ry='5' transform='rotate(-30 170 140)'/%3E%3Cellipse class='fl' cx='20' cy='160' rx='2' ry='4' transform='rotate(20 20 160)'/%3E%3Cellipse class='fl' cx='180' cy='180' rx='2' ry='3' transform='rotate(-45 180 180)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

::selection {
  background-color: var(--rosa-cipria);
  color: var(--text-dark);
}

::-moz-selection {
  background-color: var(--rosa-cipria);
  color: var(--text-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--lilla);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--rosa-cipria);
}

ul, ol {
  list-style: none;
}

/* ============================================================
   3. Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-dark);
}

h1 { font-size: 32px; }
h2 { font-size: 26px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

p {
  margin-bottom: 8px;
  line-height: 1.6;
}

small {
  font-size: 13px;
  color: var(--text-light);
}

/* ============================================================
   4. Buttons
   ============================================================ */
button,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-small {
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--rosa-cipria), var(--lilla));
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 28px;
  box-shadow: 0 4px 14px rgba(212, 184, 224, 0.35);
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 22px rgba(212, 184, 224, 0.5);
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(212, 184, 224, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-dark);
  border: 2px solid var(--lilla);
  border-radius: var(--radius-md);
  padding: 12px 26px;
}

.btn-secondary:hover {
  background: var(--lilla-light);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-success {
  background: var(--verde-salvia);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 28px;
}

.btn-success:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.btn-success:active {
  transform: scale(0.98);
}

.btn-danger {
  background: var(--reject-soft);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 28px;
}

.btn-danger:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* Disabled state for all buttons */
button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-success:disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================
   5. Cards
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.card-team {
  border-left: 4px solid var(--lilla);
  cursor: pointer;
}

.card-team.selected {
  border-left-color: var(--verde-salvia);
  background: var(--verde-salvia-light);
}

.card-submission {
  position: relative;
  overflow: hidden;
}

.card-submission::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.card-submission.status-pending::before {
  background: var(--pesca);
}

.card-submission.status-approved::before {
  background: var(--verde-salvia);
}

.card-submission.status-rejected::before {
  background: var(--reject-soft);
}

/* ============================================================
   6. Bottom Navigation
   ============================================================ */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: var(--text-light);
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
  background: none;
  border: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.nav-item .nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
  line-height: 1;
}

.nav-item.active {
  color: var(--lilla);
  font-weight: 600;
}

/* Dot indicator under active nav item */
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lilla);
}

.nav-item:hover {
  color: var(--lilla);
}

/* ============================================================
   7. Forms
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E8E0E0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px; /* ≥16px prevents iOS zoom */
  color: var(--text-dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  background: var(--white);
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--lilla);
  box-shadow: 0 0 0 3px rgba(212, 184, 224, 0.2);
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

/* Custom select arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237A7A7A' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* ============================================================
   8. Status Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  gap: 4px;
}

.badge-pending {
  background: var(--pesca);
  color: #8B5E5E;
}

.badge-approved {
  background: var(--verde-salvia-light);
  color: #4A7044;
}

.badge-rejected {
  background: var(--reject-soft);
  color: #7A3030;
}

.badge-full {
  background: var(--lilla-light);
  color: #6B4F7A;
}

/* ============================================================
   9. Toast Notifications
   ============================================================ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  color: var(--white);
  font-weight: 500;
  font-size: 14px;
  animation: slideIn 0.3s ease forwards;
  box-shadow: var(--shadow-soft);
  max-width: 340px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-success {
  background: var(--verde-salvia);
}

.toast-error {
  background: var(--reject-soft);
}

.toast-info {
  background: var(--azzurro-polvere);
  color: var(--text-dark);
}

.toast.removing {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
}

/* ============================================================
   10. Leaderboard
   ============================================================ */
.leaderboard-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f0e8e8;
  gap: 12px;
  transition: background 0.2s ease;
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-item:hover {
  background: var(--pesca-light);
}

.position-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.position-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.position-2 {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.position-3 {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.position-other {
  background: #f0e8e8;
  color: var(--text-dark);
}

.team-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}

.team-score {
  font-size: 24px;
  font-weight: 700;
  color: var(--lilla);
}

/* ============================================================
   11. Language Switcher
   ============================================================ */
.lang-switch {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.lang-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--lilla);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  -webkit-tap-highlight-color: transparent;
}

.lang-btn.active {
  background: var(--lilla);
  color: var(--white);
}

.lang-btn:hover:not(.active) {
  background: var(--lilla-light);
}

/* ============================================================
   12. Progress Bar
   ============================================================ */
.progress-bar {
  height: 8px;
  background: #f0e8e8;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rosa-cipria), var(--lilla));
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 0;
}

/* ============================================================
   13. Accordion (Rules Page)
   ============================================================ */
.accordion-item {
  border-bottom: 1px solid #f0e8e8;
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  padding: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: var(--pesca-light);
}

.accordion-header::after {
  content: '▼';
  transition: transform 0.3s ease;
  font-size: 12px;
  color: var(--text-light);
  flex-shrink: 0;
  margin-left: 12px;
}

.accordion-header.open::after {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 0 16px;
}

.accordion-body.open {
  max-height: 2000px;
  padding: 0 16px 16px;
}

/* ============================================================
   14. Page Transitions & Layout
   ============================================================ */
.page {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: none;
  padding: 0 16px 100px 16px; /* added horizontal padding, room for bottom nav */
}

.page.active {
  opacity: 1;
  transform: translateY(0);
  display: block;
}

.page-header {
  padding: 20px;
  text-align: center;
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-light);
  font-size: 14px;
}

.page-content {
  padding: 16px;
}

/* ============================================================
   15. Decorative Elements
   ============================================================ */

/* Floral divider with heart center */
.divider-floral {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
  gap: 0;
}

.divider-floral::before,
.divider-floral::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rosa-cipria), transparent);
}

.divider-floral::before {
  margin-right: 12px;
}

.divider-floral::after {
  margin-left: 12px;
}

/* Place content (emoji) via data attribute or inner text */
.divider-floral-icon {
  font-size: 18px;
  color: var(--rosa-cipria);
  flex-shrink: 0;
}

/* Floating heart decoration */
.heart-decoration {
  display: inline-block;
  color: var(--rosa-cipria);
  animation: float 3s ease-in-out infinite;
  font-size: 20px;
}

/* ============================================================
   16. Upload Area
   ============================================================ */
.upload-area {
  border: 2px dashed var(--rosa-cipria);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--pesca-light);
  -webkit-tap-highlight-color: transparent;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--lilla);
  background: var(--lilla-light);
}

.upload-area .upload-icon {
  font-size: 40px;
  margin-bottom: 8px;
  display: block;
}

.upload-area p {
  color: var(--text-light);
  font-size: 14px;
}

.upload-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  object-fit: cover;
}

/* ============================================================
   17. Score Display
   ============================================================ */
.score-display {
  text-align: center;
  padding: 20px;
}

.score-display .score-number {
  font-family: 'Playfair Display', serif;
  font-size: 56px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--rosa-cipria), var(--lilla));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.score-display .score-label {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  margin-top: 4px;
}

.points-positive {
  color: #4A7044;
  font-weight: 600;
}

.points-negative {
  color: #7A3030;
  font-weight: 600;
}

/* ============================================================
   18. Member Item
   ============================================================ */
.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0e8e8;
}

.member-item:last-child {
  border-bottom: none;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rosa-cipria), var(--lilla));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   19. Submission Item
   ============================================================ */
.submission-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0e8e8;
  align-items: flex-start;
}

.submission-item:last-child {
  border-bottom: none;
}

.submission-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #f0e8e8;
}

.submission-details {
  flex: 1;
  min-width: 0;
}

.submission-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.submission-meta {
  font-size: 12px;
  color: var(--text-light);
}

/* ============================================================
   20. Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-family: 'Playfair Display', serif;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0e8e8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-light);
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: var(--reject-soft);
  color: var(--white);
}

/* ============================================================
   21. Custom Checkbox
   ============================================================ */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0;
  -webkit-tap-highlight-color: transparent;
}

.checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 22px;
  height: 22px;
  border: 2px solid var(--lilla);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--lilla);
  border-color: var(--lilla);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
}

.checkbox-label {
  font-size: 15px;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   22. Loading Spinner (CSS-only)
   ============================================================ */
.loading-spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--lilla-light);
  border-top-color: var(--lilla);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner.small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Heart Spinner */
.spinner-heart {
  display: inline-block;
  position: relative;
  width: 64px;
  height: 64px;
  transform: rotate(45deg);
  transform-origin: 32px 32px;
  margin: 20px auto;
}
.spinner-heart div {
  top: 23px;
  left: 19px;
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--lilla);
  animation: spinner-heart 1.2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}
.spinner-heart div:after,
.spinner-heart div:before {
  content: " ";
  position: absolute;
  display: block;
  width: 26px;
  height: 26px;
  background: var(--lilla);
}
.spinner-heart div:before {
  left: -17px;
  border-radius: 50% 0 0 50%;
}
.spinner-heart div:after {
  top: -17px;
  border-radius: 50% 50% 0 0;
}
@keyframes spinner-heart {
  0% { transform: scale(0.95); }
  5% { transform: scale(1.1); }
  39% { transform: scale(0.85); }
  45% { transform: scale(1); }
  60% { transform: scale(0.95); }
  100% { transform: scale(0.9); }
}

/* Full-page loading state */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.loading-state p {
  color: var(--text-light);
  font-size: 14px;
}

/* ============================================================
   23. Empty State
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state h3 {
  font-family: 'Playfair Display', serif;
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 20px;
}

.empty-state p {
  font-size: 14px;
  max-width: 260px;
}

/* ============================================================
   24. Admin-Specific Styles
   ============================================================ */
.admin-panel {
  background: linear-gradient(180deg, rgba(235, 217, 242, 0.12) 0%, transparent 200px);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(255, 165, 0, 0.3);
}

.admin-badge.admin-danger {
  background: linear-gradient(135deg, #E8A0A0, #C47070);
}

/* Filter Bar (horizontal scrolling) */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #E8E0E0;
  white-space: nowrap;
  transition: all 0.2s ease;
  background: var(--white);
  font-family: inherit;
  color: var(--text-dark);
  -webkit-tap-highlight-color: transparent;
}

.filter-chip.active {
  background: var(--lilla);
  color: var(--white);
  border-color: var(--lilla);
}

.filter-chip:hover:not(.active) {
  background: var(--lilla-light);
  border-color: var(--lilla-light);
}

/* Submission review card (admin) */
.submission-review-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 16px;
}

.submission-review-card .media-preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0e8e8;
}

.submission-review-card .review-content {
  padding: 16px;
}

.submission-review-card .review-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #f0e8e8;
}

.submission-review-card .review-actions button {
  flex: 1;
}

/* Admin stat card */
.admin-stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.admin-stat-card .stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--rosa-cipria), var(--lilla));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.admin-stat-card .stat-label {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
  margin-top: 4px;
}

/* Admin tab bar */
.admin-tab-bar {
  display: flex;
  border-bottom: 2px solid #f0e8e8;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-tab-bar .tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.admin-tab-bar .tab.active {
  color: var(--lilla);
}

.admin-tab-bar .tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--lilla);
  border-radius: 2px 2px 0 0;
}

.admin-tab-bar .tab:hover:not(.active) {
  color: var(--text-dark);
}

/* ============================================================
   25. Prediction & Challenge Items
   ============================================================ */
.prediction-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0e8e8;
}

.prediction-item:last-child {
  border-bottom: none;
}

.prediction-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lilla-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.prediction-content {
  flex: 1;
  min-width: 0;
}

.prediction-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.prediction-answer {
  font-size: 13px;
  color: var(--text-light);
}

.challenge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.challenge-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.challenge-item .challenge-points {
  font-weight: 700;
  font-size: 20px;
  color: var(--lilla);
  flex-shrink: 0;
  min-width: 50px;
  text-align: center;
}

.challenge-item .challenge-info {
  flex: 1;
  min-width: 0;
}

.challenge-item .challenge-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.challenge-item .challenge-desc {
  font-size: 13px;
  color: var(--text-light);
}

/* ============================================================
   26. Animations
   ============================================================ */
@keyframes fadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes confetti {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  25%  { transform: translateY(-40px) rotate(90deg) translateX(20px); }
  50%  { transform: translateY(-20px) rotate(180deg) translateX(-10px); }
  75%  { transform: translateY(-60px) rotate(270deg) translateX(15px); opacity: 0.5; }
  100% { transform: translateY(-80px) rotate(360deg) translateX(0); opacity: 0; }
}

@keyframes pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.5; }
  100% { opacity: 1; }
}

@keyframes float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* Animation utility classes */
.animate-fadeIn   { animation: fadeIn 0.4s ease forwards; }
.animate-bounceIn { animation: bounceIn 0.5s ease forwards; }
.animate-pulse    { animation: pulse 2s ease-in-out infinite; }
.animate-float    { animation: float 3s ease-in-out infinite; }

/* ============================================================
   27. Utility Classes
   ============================================================ */

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Margins — top */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* Margins — bottom */
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* Flexbox helpers */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }

/* Gaps */
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Visibility */
.hidden { display: none !important; }

/* ============================================================
   28. Media Queries (Responsive)
   ============================================================ */

/* Tablets and up */
@media (min-width: 600px) {
  h1 { font-size: 38px; }
  h2 { font-size: 30px; }
  h3 { font-size: 26px; }

  .page-header h1 {
    font-size: 34px;
  }

  .card {
    padding: 24px;
  }

  .score-display .score-number {
    font-size: 64px;
  }

  #toast-container {
    top: 28px;
    right: 28px;
  }

  .toast {
    max-width: 400px;
  }

  .admin-stat-card .stat-number {
    font-size: 42px;
  }
}

/* Desktop */
@media (min-width: 900px) {
  .page-content,
  .page-header {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  #bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: none;
  }

  .modal {
    max-width: 480px;
  }
}

/* ============================================================
   29. iOS / Safari Specific Fixes
   ============================================================ */

/* Prevent zoom on input focus (iOS) */
@supports (-webkit-touch-callout: none) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px;
  }
}

/* Safe area padding for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
  #bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }

  .page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   30. Print Styles
   ============================================================ */
@media print {
  #bottom-nav,
  #toast-container,
  .btn-primary,
  .btn-secondary,
  .btn-success,
  .btn-danger {
    display: none !important;
  }

  body {
    background: white;
    background-image: none;
    color: black;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
