/* --- Base Setup --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Georgia', serif;
  background-color: #0d0c0e; /* Deep obsidian black */
  color: #c5b3c9; /* Soft, muted lavender/silver for text */
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- Main Website Content --- */
#main-content {
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  text-align: center;
  padding: 20px;
}

#main-content.revealed {
  opacity: 1;
}

#main-content h1 {
  font-size: 2.5rem;
  color: #8a4f91; /* Vibrant gothic purple */
  text-shadow: 0 0 10px rgba(138, 79, 145, 0.3);
  margin-bottom: 15px;
  font-weight: 300;
}

/* --- Gatekeeper Overlay --- */
#gatekeeper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(13, 12, 14, 0.95); /* Matches body background */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

#gatekeeper.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 90%;
  max-width: 400px;
  padding: 40px 30px;
  text-align: center;
}

.login-card h2 {
  font-size: 1.8rem;
  font-weight: 300;
  margin-bottom: 10px;
  color: #a366ab; /* Velvet purple */
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-card p {
  font-size: 0.95rem;
  color: #6d5c6e; /* Darker, moody purple-gray */
  margin-bottom: 30px;
  font-style: italic;
}

/* --- Form Elements --- */
.form-group {
  position: relative;
  margin-bottom: 20px;
}

.passcode-input {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid #2e2530; /* Dark border */
  background: transparent;
  font-family: inherit;
  font-size: 1.1rem;
  color: #e6def0;
  text-align: center;
  outline: none;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.passcode-input:focus {
  border-color: #8a4f91; /* Glows purple on focus */
  box-shadow: 0 1px 0 #8a4f91;
}

.passcode-input::placeholder {
  color: #423745; /* Subtle, dark placeholder */
  font-size: 0.95rem;
}

.submit-btn {
  background-color: #5c2c61; /* Deep, moody purple button */
  color: #ffffff;
  border: 1px solid #7d3f85;
  padding: 12px 35px;
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 2px;
  border-radius: 4px; /* Swapped rounded pills for a sharper, classic gothic edge */
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  background-color: #723479;
  border-color: #a366ab;
  box-shadow: 0 0 15px rgba(138, 79, 145, 0.4);
}

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

/* --- Error Message --- */
.error-message {
  height: 20px;
  margin-top: 15px;
  font-size: 0.85rem;
  color: #b33939; /* Deep crimson red for the error */
  font-style: italic;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.error-message.show {
  opacity: 1;
}

/* --- Timer Style --- */
.timer-container {
  margin-top: 40px;
  padding: 20px;
  border-top: 1px dashed #423745;
}
.timer-title {
  font-size: 0.9rem;
  color: #6d5c6e;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
}
#love-counter {
  font-size: 1.2rem;
  color: #a366ab;
  font-family: 'Georgia', serif;
}

/* --- Daily Message --- */
.message-container {
  margin: 30px auto;
  max-width: 500px;
  padding: 20px;
  background: rgba(46, 37, 48, 0.2); /* Muted, semi-transparent purple-black */
  border-left: 3px solid #8a4f91; /* Velvet purple accent bar */
  border-radius: 4px;
}

.message-title {
  font-size: 0.8rem;
  color: #6d5c6e;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

#daily-message {
  font-size: 1.1rem;
  color: #e6def0;
  font-style: italic;
  line-height: 1.5;
}

/* --- Checklist Container --- */
.dates-container {
  max-width: 500px;
  margin: 40px auto;
  padding: 25px;
  background: #141215;
  border: 1px solid #2e2530;
  border-radius: 8px;
  text-align: left;
}

.dates-title {
  font-size: 1.4rem;
  color: #a366ab;
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.dates-subtitle {
  font-size: 0.85rem;
  color: #6d5c6e;
  font-style: italic;
  margin-bottom: 20px;
}

/* --- Tab System Buttons --- */
.tab-controls {
  display: flex;
  border-bottom: 1px solid #2e2530;
  margin-bottom: 15px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #6d5c6e;
  padding: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  color: #e6def0;
}

.tab-btn.active {
  color: #a366ab;
  border-bottom: 2px solid #8a4f91;
  font-weight: bold;
}

/* --- Checklist Items --- */
.checklist {
  list-style: none;
}

.checklist-item {
  position: relative;
  display: flex;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid #1d1820;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease, opacity 0.4s ease, transform 0.4s ease;
}

.checklist-item:hover {
  background-color: #1a161c;
}

/* Outgoing animation modifier when items switch tabs */
.checklist-item.slide-out {
  opacity: 0;
  transform: translateX(30px);
  pointer-events: none;
}

/* --- Custom Checkbox Layout --- */
.checklist-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.custom-checkbox {
  position: relative;
  height: 18px;
  width: 18px;
  background-color: transparent;
  border: 1px solid #5c2c61;
  border-radius: 3px;
  margin-right: 15px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.checklist-item input:checked ~ .custom-checkbox {
  background-color: #5c2c61;
  border-color: #8a4f91;
}

.custom-checkbox::after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #e6def0;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checklist-item input:checked ~ .custom-checkbox::after {
  display: block;
}

/* --- Text Label Styles & Strike-through --- */
.date-text {
  font-size: 1rem;
  color: #e6def0;
  transition: all 0.4s ease;
}

.checklist-item input:checked ~ .date-text {
  color: #544757;
  text-decoration: line-through;
  text-decoration-color: #723479;
}

/* --- Confetti Burst Particles --- */
.confetti-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  top: 20px;
  left: 20px;
  animation: burst 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes burst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(0.3);
    opacity: 0;
  }
}

/* --- Request Form Container --- */
.request-container {
  max-width: 500px;
  margin: 40px auto;
  padding: 25px;
  background: #141215;
  border: 1px solid #2e2530;
  border-radius: 8px;
  text-align: left;
}

.request-title {
  font-size: 1.4rem;
  color: #a366ab;
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.request-subtitle {
  font-size: 0.85rem;
  color: #6d5c6e;
  font-style: italic;
  margin-bottom: 25px;
}

/* --- Form Fields --- */
.form-field {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: 0.85rem;
  color: #a366ab;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* Base style for inputs, dropdowns, and textareas */
.form-field select,
.form-field input[type="date"],
.form-field textarea {
  background-color: #0d0c0e;
  border: 1px solid #2e2530;
  border-radius: 4px;
  color: #e6def0;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none; /* Removes default iOS input styling rounding hooks */
}

/* Subtle accent color pop for the native OS calendar icon picker */
.form-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(53%) sepia(21%) saturate(934%) hue-rotate(242deg) brightness(87%) contrast(83%);
  cursor: pointer;
}

.form-field select:focus,
.form-field input[type="date"]:focus,
.form-field textarea:focus {
  border-color: #8a4f91;
  box-shadow: 0 0 8px rgba(138, 79, 145, 0.2);
}

.form-field textarea {
  resize: vertical; /* Allows desktop tracking layout shifting natively down only */
}

/* --- Validation Error Styling --- */
.form-error-msg {
  color: #b33939;
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 5px;
  display: none;
}

.form-error-msg.visible {
  display: block;
}

/* --- Submit Button --- */
.submit-request-btn {
  width: 100%;
  background-color: #5c2c61;
  color: #ffffff;
  border: 1px solid #7d3f85;
  padding: 14px;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-request-btn:hover {
  background-color: #723479;
  border-color: #a366ab;
  box-shadow: 0 0 15px rgba(138, 79, 145, 0.4);
}

/* --- Success Message Fade-in --- */
.success-message {
  text-align: center;
  padding: 20px 10px;
  animation: fadeIn 0.6s ease-in-out forwards;
}

.success-message h2 {
  color: #a366ab;
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.success-message p {
  color: #e6def0;
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.6;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}