.contest-entry-form {
  position: relative;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(33, 8, 6, 0.24);
}

.contest-entry-form .form-field {
  margin-bottom: 26px;
}

.contest-entry-form .form-field > label:first-child,
.contest-entry-form .form-legend {
  font-size: 1.02rem;
}

.contest-entry-form input[type="text"],
.contest-entry-form input[type="email"],
.contest-entry-form input[type="tel"],
.contest-entry-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  color: #170b09;
  background: #fffdf8;
  border: 1px solid rgba(116, 29, 29, 0.32);
  border-radius: 8px;
  font: inherit;
  line-height: 1.55;
}

.contest-entry-form textarea {
  min-height: 112px;
  resize: vertical;
}

.contest-entry-form input:focus,
.contest-entry-form textarea:focus {
  outline: 3px solid rgba(184, 138, 55, 0.28);
  border-color: #b88a37;
}

.field-help,
.character-count,
.submit-note {
  margin: 0;
  color: #5d4a43;
  font-size: 0.88rem;
  line-height: 1.6;
}

.character-count {
  justify-self: end;
}

.required,
.optional {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.7;
  vertical-align: 0.08em;
}

.required {
  color: #fff;
  background: #8b211d;
}

.optional {
  color: #5d4a43;
  background: #e9dcc4;
}

.photo-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.photo-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 58px;
  padding: 12px 20px;
  color: #741d1d;
  background: #fffaf0;
  border: 2px dashed #b88a37;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.photo-picker-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.photo-picker:focus-within,
.photo-field input[type="file"]:focus + .photo-previews {
  outline: 3px solid rgba(184, 138, 55, 0.28);
}

.photo-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.photo-preview {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #ede2d1;
  border: 1px solid rgba(116, 29, 29, 0.18);
  border-radius: 8px;
}

.photo-preview img,
.photo-preview-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.photo-preview-placeholder {
  display: grid;
  place-items: center;
  padding: 8px;
  color: #741d1d;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.45;
}

.photo-preview-name {
  overflow: hidden;
  margin: 0;
  padding: 6px 7px;
  font-size: 0.7rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 48px;
  min-height: 34px;
  padding: 5px 9px;
  color: #fff;
  background: rgba(79, 15, 13, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.photo-remove:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.photo-selection-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 8px 0 0;
  color: #5d4a43;
  font-size: 0.82rem;
  line-height: 1.55;
}

#photoSelectionMessage:not(:empty) {
  color: #741d1d;
  font-weight: 700;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.form-alert,
.form-message {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.65;
}

.form-alert,
.form-message.is-error {
  color: #741d1d;
  background: #fff0ec;
  border: 1px solid #d8998e;
}

.form-message.is-info {
  color: #4f380e;
  background: #fff6d9;
  border: 1px solid #d5b65e;
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 22px 0;
  overflow: hidden;
}

.upload-progress {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.upload-item {
  padding: 10px 12px;
  background: #fffaf0;
  border: 1px solid rgba(116, 29, 29, 0.18);
  border-radius: 8px;
}

.upload-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.upload-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #dfd3c0;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #a72b25, #d1a33e);
  border-radius: inherit;
  transition: width 180ms ease;
}

.submit-button.is-loading .button-spinner {
  display: inline-block;
}

.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -3px;
  animation: contest-spin 0.75s linear infinite;
}

.submit-note {
  margin-top: 10px;
  text-align: center;
}

.submit-button:not(:disabled) {
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 6px 0 #4f100e, 0 12px 24px rgba(79, 16, 14, 0.24);
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease;
  -webkit-tap-highlight-color: rgba(184, 138, 55, 0.28);
}

@media (hover: hover) and (pointer: fine) {
  .submit-button:not(:disabled):hover {
    background: #971f1b;
    border-color: #971f1b;
    box-shadow: 0 8px 0 #4f100e, 0 16px 30px rgba(79, 16, 14, 0.32);
    transform: translateY(-2px);
  }
}

.submit-button:not(:disabled):focus-visible {
  outline: 4px solid #d2a63c;
  outline-offset: 4px;
}

.submit-button:not(:disabled):active {
  box-shadow: 0 2px 0 #4f100e, 0 6px 14px rgba(79, 16, 14, 0.26);
  transform: translateY(4px);
}

.rules-box {
  max-height: none !important;
  overflow: visible !important;
}

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

@media (max-width: 420px) {
  .photo-previews {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .turnstile-wrap {
    justify-content: flex-start;
    transform-origin: left top;
  }
}

@media (min-width: 760px) {
  .contest-entry-form {
    max-width: 760px;
    margin-inline: auto;
  }

  .photo-previews {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button-spinner { animation-duration: 1.5s; }
  .progress-bar { transition: none; }
  .submit-button:not(:disabled) { transition: none; }
}
