* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at top, #ffe6ee 0%, #ffd1df 35%, #fff4f7 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 12px;
  color: #2b1b22;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -20vh;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 75, 92, 0.18) 0 8px, transparent 9px),
    radial-gradient(circle at 80% 30%, rgba(255, 75, 92, 0.14) 0 6px, transparent 7px),
    radial-gradient(circle at 30% 75%, rgba(255, 75, 92, 0.12) 0 7px, transparent 8px);
  animation: floatHearts 10s ease-in-out infinite;
}

body::after {
  animation-duration: 14s;
  opacity: 0.75;
  filter: blur(0.2px);
}

.login-container,
.home-container,
.add-container,
.admin-container {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(43, 27, 34, 0.12);
  width: 100%;
  max-width: 480px;
  color: #2b1b22;
  margin-top: 10px;
}

h1,
h2 {
  margin-bottom: 16px;
  color: #ff4b5c;
  font-family: "Playfair Display", serif;
}

p {
  color: #2b1b22;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}

img {
  width: 100%;
  max-width: 520px;
  margin: 0 auto 20px auto;
  display: block;
  border: 2px solid #ff4b5c;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(255, 75, 92, 0.18);
}

form {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
}

input,
textarea,
select {
  width: 100%;
  max-width: 320px;
  padding: 12px 14px;
  margin: 6px 0;
  border: 1px solid rgba(255, 75, 92, 0.3);
  border-radius: 12px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95em;
  background: #ffffff;
  color: #2b1b22;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #ff4b5c;
  box-shadow: 0 0 0 3px rgba(255, 75, 92, 0.15);
}

input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

input[type="file"] {
  padding: 10px;
  cursor: pointer;
}

.image-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  min-height: 180px;
  border: 2px dashed rgba(255, 75, 92, 0.4);
  border-radius: 14px;
  cursor: pointer;
  margin: 8px 0;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: rgba(255, 255, 255, 0.5);
}

.image-picker:hover {
  border-color: #ff4b5c;
  background: rgba(255, 75, 92, 0.05);
}

.image-picker input[type="file"] {
  display: none;
}

.image-picker-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ff4b5c;
  font-size: 0.95em;
  padding: 20px;
}

.image-picker-icon {
  font-size: 32px;
}

.image-preview {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  border: none;
  box-shadow: none;
  margin: 0;
}

.reasons-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  margin: 10px auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(43, 27, 34, 0.12);
  color: #2b1b22;
}

.calendar-header {
  margin-bottom: 16px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-nav .btn {
  padding: 8px 12px;
  min-width: 40px;
  max-width: 40px;
  flex-shrink: 0;
}

.calendar-selector {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
}

.calendar-selector select,
.calendar-selector input {
  margin: 0;
  padding: 6px 8px;
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
  font-size: 14px;
}

.calendar-selector select {
  max-width: 100px;
}

.calendar-selector input {
  max-width: 70px;
}

.calendar-selector button {
  margin: 0;
  padding: 6px 12px;
  font-size: 14px;
  max-width: 50px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
}

.calendar-dow {
  text-align: center;
  font-weight: 700;
  color: #ff4b5c;
  padding: 6px 0;
}

.calendar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 75, 92, 0.25);
  border-radius: 10px;
  aspect-ratio: 1;
  padding: 4px;
  color: #2b1b22;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(255, 75, 92, 0.18);
}

.calendar-cell--empty {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.calendar-cell--has {
  border-color: #ff4b5c;
}

.calendar-cell--missing {
  opacity: 0.55;
}

.calendar-cell--today {
  box-shadow: 0 0 0 2px rgba(255, 75, 92, 0.35);
}

.calendar-cell--future {
  background: rgba(0, 0, 0, 0.04);
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.calendar-cell--future .calendar-dot {
  font-size: 12px;
  margin-top: 6px;
}

.calendar-day {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  line-height: 1;
}

.calendar-dot {
  margin-top: 10px;
  height: 14px;
  font-size: 22px;
  color: #ff4b5c;
  text-align: center;
}

.comments {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 15px;
  color: #2b1b22;
  border: 1px solid rgba(255, 75, 92, 0.16);
}

.comment {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  border: 1px solid rgba(255, 75, 92, 0.2);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-date {
  opacity: 0.7;
  font-size: 0.9em;
}

.comment-body {
  white-space: pre-wrap;
}

.reasons-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex-direction: column;
  margin-top: 10px;
  gap: 14px;
}

.reason-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(43, 27, 34, 0.08);
  overflow: hidden;
  margin-bottom: 20px;
  padding: 12px;
  color: #2b1b22;
  border: 1px solid rgba(255, 75, 92, 0.16);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.reason-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(43, 27, 34, 0.12);
}

.reason-card--link {
  display: block;
  text-decoration: none;
}

.hint {
  opacity: 0.75;
}

.reason-badge {
  display: inline-block;
  margin: 0 0 10px 0;
  padding: 6px 10px;
  background: rgba(255, 75, 92, 0.12);
  border: 1px solid rgba(255, 75, 92, 0.25);
  border-radius: 999px;
  color: #ff4b5c;
  font-weight: 700;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}

.date-soft {
  margin-top: -10px;
  opacity: 0.8;
}

/* Date et countdown stylés */
.date-countdown-box {
  background: rgba(255, 75, 92, 0.08);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  text-align: center;
}

.date-today {
  font-family: "Playfair Display", serif;
  font-size: 1.3em;
  font-weight: 600;
  color: #2b1b22;
  margin-bottom: 12px;
  text-transform: capitalize;
}

.countdown-label {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 4px;
}

.countdown-timer {
  font-family: "Inter", sans-serif;
  font-size: 1.8em;
  font-weight: 700;
  color: #ff4b5c;
  letter-spacing: 2px;
}

.reason-image {
  width: 100%;
  height: auto;
  border-bottom: 2px solid #ff4b5c;
}

.reason-details {
  padding: 10px;
}

.reason-details p {
  margin: 5px 0;
}

.loading-spinner {
  border: 8px solid rgba(255, 255, 255, 0.3);
  border-top: 8px solid #ff4b5c;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  width: 100%;
  max-width: 280px;
  color: #ffffff;
  background: linear-gradient(135deg, #ff4b5c 0%, #ff7aa7 100%);
  border: 1px solid #ff4b5c;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 10px;
  text-decoration: none;
  text-align: center;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95em;
  font-weight: 500;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn-back {
  background: #ffffff;
  color: #ff4b5c;
  border-color: rgba(255, 75, 92, 0.4);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(255, 75, 92, 0.22);
}

.btn-back:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(80, 80, 80, 0.22);
}

.btn-view-reasons-container {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  width: 100%;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

.nav-title {
  text-align: center;
  font-family: "Playfair Display", serif;
  color: #ff4b5c;
  font-size: 16px;
  text-transform: capitalize;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  background: #ffffff;
  border: 1px solid rgba(255, 75, 92, 0.4);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #ff4b5c;
  border-radius: 2px;
}

.profile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(255, 75, 92, 0.4);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
}

.nav-menu {
  display: none;
  gap: 10px;
  margin: 10px 0 20px;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 75, 92, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.nav-menu--open {
  display: flex;
}

.nav-menu form {
  margin-bottom: 0;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(255, 75, 92, 0.4);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 300;
  color: #ff4b5c;
  line-height: 1;
}

.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 320px;
}

.input-with-toggle input {
  width: 100%;
  max-width: none;
  padding-right: 36px;
  margin: 8px 0;
}

.toggle-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #ff4b5c;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-icon:hover {
  transform: translateY(-50%) scale(1.05);
}

.calendar-title {
  font-family: "Playfair Display", serif;
  font-size: 16px;
  color: #ff4b5c;
  text-transform: capitalize;
  text-align: center;
  min-width: 120px;
}

.author-pill {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 75, 92, 0.12);
  color: #ff4b5c;
  font-weight: 600;
  font-size: 0.9em;
}

input,
textarea,
select {
  display: block;
  margin-bottom: 8px;
  margin-top: 8px;
  padding: 14px 16px;
  width: 100%;
  max-width: 320px;
  border: 1px solid rgba(255, 75, 92, 0.5);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.95);
  color: #2b1b22;
  font-size: 16px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 75, 92, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: #a06676;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  width: 100%;
  max-width: 280px;
  color: #ffffff;
  background: linear-gradient(135deg, #ff4b5c 0%, #ff7aa7 100%);
  border: 1px solid #ff4b5c;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 12px;
  text-decoration: none;
  text-align: center;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 1em;
  font-weight: 500;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(255, 75, 92, 0.22);
}

button[disabled],
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.2);
  box-shadow: none !important;
}

.error {
  color: #d83b64;
}

.reason-item {
  background-color: rgba(255, 255, 255, 0.85);
  color: #2b1b22;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 75, 92, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.reason-item img {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
}

.reason-item p {
  margin: 10px 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  width: 100%;
}

.reason-item .btn,
.reason-item button {
  width: 100%;
  max-width: 280px;
  padding: 10px 16px;
  margin: 4px 0;
  box-sizing: border-box;
}

.reason-item button {
  background: linear-gradient(135deg, #ff4b5c 0%, #ff7aa7 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.reason-item button.delete {
  background: linear-gradient(135deg, #c7c7c7 0%, #9aa0a6 100%);
  color: #1f1f1f;
}

.reason-item button:hover {
  transform: translateY(-1px);
}

.floating-heart {
  position: fixed;
  bottom: -20px;
  z-index: 1;
  animation: floatUp linear forwards;
  pointer-events: none;
  text-shadow: 0 6px 14px rgba(255, 75, 92, 0.25);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  10% {
    transform: scale(1.02);
  }
  20% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.03);
  }
  40% {
    transform: scale(1);
  }
}

@keyframes floatUp {
  from {
    transform: translateY(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  to {
    transform: translateY(-120vh) scale(1.4);
    opacity: 0;
  }
}

@keyframes floatHearts {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(0, -14px, 0) rotate(1deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

/* Section titre profil/page */
.section-title {
  font-family: "Playfair Display", serif;
  color: #ff4b5c;
  font-size: 1.1em;
  margin: 20px 0 8px 0;
  text-align: center;
}

.section-title:first-of-type {
  margin-top: 12px;
}

.couple-members {
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.members-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.member-pill {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(255, 75, 92, 0.1);
  border: 1px solid rgba(255, 75, 92, 0.25);
  border-radius: 999px;
  color: #ff4b5c;
  font-size: 0.9em;
  font-weight: 500;
}

.member-pill--me {
  background: rgba(255, 75, 92, 0.2);
  border-color: #ff4b5c;
  font-weight: 600;
}

/* Écrans moyens et grands */
@media (min-width: 481px) {
  .login-container,
  .home-container,
  .add-container,
  .admin-container,
  .reasons-container {
    max-width: 520px;
    padding: 24px;
  }

  .calendar-grid {
    gap: 6px;
  }

  .calendar-cell {
    border-radius: 12px;
  }

  input,
  textarea,
  select {
    max-width: 360px;
  }

  .input-with-toggle {
    max-width: 360px;
  }
}

/* Petits écrans */
@media (max-width: 480px) {
  body {
    padding: 8px;
    align-items: flex-start;
  }

  .admin-container,
  .home-container,
  .login-container,
  .reasons-container {
    padding: 14px;
    border-radius: 14px;
  }

  .top-nav {
    margin-bottom: 8px;
  }

  .calendar-cell {
    border-radius: 8px;
  }

  .calendar-day {
    font-size: 14px;
  }

  .calendar-dot {
    font-size: 16px;
    margin-top: 2px;
  }

  .calendar-nav .btn {
    padding: 8px 12px;
    font-size: 0.9em;
  }

  .calendar-title {
    font-size: 14px;
  }

  h1 {
    font-size: 1.3em;
    margin-bottom: 12px;
  }

  h2 {
    font-size: 1em;
  }

  .btn {
    padding: 12px 18px;
  }

  button {
    padding: 12px 18px;
  }

  img {
    width: 100%;
    max-width: none;
    border-radius: 12px;
  }
}