.cbc-submission-bg {
  background:
    url("/assets/CBC-Kids-Celebrates-Submission-Tool-Background.png")
      center center/cover no-repeat,
    linear-gradient(135deg, #eff6ff 0%, #cfe3ff 100%);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}

body.cbc-submission-bg {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    url("/assets/CBC-Kids-Celebrates-Submission-Tool-Background.png")
      center center/cover no-repeat,
    linear-gradient(135deg, #eff6ff 0%, #cfe3ff 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #1d2a37;
}

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  max-width: 620px;
  width: 100%;
  padding: 40px 36px 32px;
}

.logo {
  text-align: center;
  margin-bottom: 20px;
}

.logo img {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.logo h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #1d4ed8;
}

.logo p {
  color: #666;
  font-size: 0.95rem;
  margin-top: 4px;
}

.privacy,
.acceptance-window {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.acceptance-window {
  background: linear-gradient(135deg, #e3f2fd 0%, #e1f5fe 100%);
  border: 2px solid #42a5f5;
  color: #0d47a1;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 3px 12px rgba(66, 165, 245, 0.25);
}

.acceptance-window strong {
  font-size: 1rem;
  color: #1565c0;
}

.privacy {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

form {
  margin-top: 8px;
}

.grid {
  display: block;
}

.field {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}

input,
select,
textarea,
button {
  width: 100%;
  font: inherit;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.hint {
  margin-top: 3px;
  color: #888;
  font-size: 0.78rem;
}

.consent-row {
  padding-top: 6px;
  padding-bottom: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.84rem;
  line-height: 1.35;
}

.consent-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.actions {
  margin-top: 8px;
}

.actions button {
  background: #2563eb;
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  padding: 12px;
}

.actions button:hover {
  background: #1e40af;
}

.actions button:disabled {
  background: #93a9d9;
  cursor: wait;
}

#status {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

#status.success {
  display: block;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

#status.error {
  display: block;
  background: #fdeeee;
  border: 1px solid #efc0c0;
  color: #8a1f1f;
}

#status.info {
  display: block;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}

#photo-preview {
  display: none;
  width: 100%;
  height: 180px;
  object-fit: contain;
  object-position: center;
  background: #f7f9fc;
  border-radius: 9px;
  border: 1px solid #d5dae4;
  margin-top: 8px;
}

#successModal,
#termsModal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(8, 18, 38, 0.58);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#successModal.open,
#termsModal.open {
  display: flex;
}

.modal-card {
  max-width: 520px;
  width: 100%;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
}

.modal-card.modal-card-scroll {
  max-height: min(80vh, 720px);
  overflow-y: auto;
}

.modal-card h2 {
  margin: 0;
  color: #1d3f8f;
}

.modal-card p {
  margin: 10px 0 0;
  line-height: 1.45;
}

.modal-card button {
  margin-top: 14px;
  background: #1d3f8f;
  color: #fff;
  border: 0;
  cursor: pointer;
}

.terms-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d3f8f;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  width: auto;
}

.terms-copy {
  margin-top: 12px;
}

.terms-copy p {
  margin: 0 0 12px;
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .card {
    padding: 22px 18px;
  }
}

/* Custom flatpickr styling */
.flatpickr-calendar {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
  border: 1px solid #e0e0e0;
  font-family: "Segoe UI", Arial, sans-serif;
}

.flatpickr-months {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  border-radius: 12px 12px 0 0;
  padding: 12px 0;
}

.flatpickr-current-month {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year,
.flatpickr-current-month .numInputWrapper span.arrowUp,
.flatpickr-current-month .numInputWrapper span.arrowDown {
  color: #fff !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
  fill: #fff !important;
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
  fill: #bfdbfe !important;
}

.flatpickr-weekdays {
  background: #f5f5f5;
  margin: 0;
}

.flatpickr-weekday {
  color: #666;
  font-weight: 600;
  font-size: 0.85rem;
}

.flatpickr-day {
  border-radius: 8px;
  font-weight: 700;
  color: #333;
  transition: all 0.2s ease;
}

.flatpickr-day:hover:not(.flatpickr-disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: scale(1.05);
}

.flatpickr-day.today {
  border: 2px solid #60a5fa;
  font-weight: 600;
  background: #eff6ff;
}

.flatpickr-day.selected {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  border-color: #2563eb;
  color: #fff;
  font-weight: 600;
}

.flatpickr-day.selected:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.flatpickr-day.flatpickr-disabled {
  color: #bbb !important;
  background: #fafafa;
  text-decoration: line-through;
  cursor: not-allowed;
}

.flatpickr-day.flatpickr-disabled:hover {
  background: #fafafa;
  border-color: transparent;
  transform: none;
}

.flatpickr-monthSelect-month,
.numInput {
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
}

.flatpickr-monthSelect-month:hover,
.numInput:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Special styling for the date input field */
#celebration_date {
  background: #fff;
  cursor: pointer;
  position: relative;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px 20px;
}

#celebration_date:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

/* Private edit link (success popup and edit page) */
.edit-link-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
  font-size: 0.88rem;
}

.edit-link-box p {
  margin: 6px 0 10px;
}

.edit-link-row {
  display: flex;
  gap: 8px;
}

.edit-link-row input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.85rem;
}

.modal-card .edit-link-row button {
  margin-top: 0;
  width: auto;
  flex: 0 0 auto;
}

.edit-intro {
  margin: 0 0 14px;
  line-height: 1.45;
}

#current-photo {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f7f9fc;
  border-radius: 9px;
  border: 1px solid #d5dae4;
  margin-bottom: 8px;
}

.actions .button-danger {
  margin-top: 10px;
  background: #fff;
  color: #8a1f1f;
  border: 1.5px solid #efc0c0;
}

.actions .button-danger:hover {
  background: #fdeeee;
}

#current-photo[hidden] {
  display: none;
}
