/* Upload-resume form (Dutch and English): partials/upload-resume-form.php */

/* Messages: inside the card, right above the Upload button */
#status {
  color: #c0392b;
  font-size: 14px;
  margin: 0 0 12px;
}

#status:empty {
  display: none;
}

/* What is missing is marked in red until the visitor fixes it */
.upload-dropzone.needs-file {
  border-color: #c0392b;
  background: #fdf3f2;
}

.consent-label.needs-consent {
  color: #c0392b !important;
}

/* ---- The form as a card, in the same style as the create form (teal border, rounded corners) ---- */
/* Narrower than the page: the whole form fits in one glance (the drop zone is no longer a huge empty area) */
.upload-card {
  max-width: 720px;
  margin: 0 auto;
  border: 2px solid #02899c;
  border-radius: 15px;
  padding: 24px;
  background: #fff;
  box-sizing: border-box;
  transition: opacity 0.7s ease;
}

#explanation-text {
  margin: 0 0 18px;
}

/* ---- Drop zone ---- */
.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 16px;
  border: 2px dashed #8cc9d1;
  border-radius: 12px;
  background: #f4fafb;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
  margin: 0 0 18px;
  /* The theme colours every form label teal; here only the link and the button are teal */
  color: #333 !important;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  background: #e6f4f6;
  border-color: #008699;
}

/* Keyboard focus on the (hidden) file field shows on the drop zone */
.upload-card:has(#resume-file:focus-visible) .upload-dropzone {
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
}

.upload-dropzone__icon {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #008699;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-dropzone__main,
.upload-dropzone__pointer,
.upload-dropzone__touch {
  font-size: 15px;
  color: #333 !important;
}

.upload-dropzone__link {
  color: #008699 !important;
  font-weight: 600;
  text-decoration: underline;
}

/* Computers: "drag here or choose a file"; phones and tablets (no hover): "tap here to choose a file" */
.upload-dropzone__touch {
  display: none;
}

@media (hover: none) {
  .upload-dropzone__pointer {
    display: none;
  }

  .upload-dropzone__touch {
    display: inline;
  }
}

.upload-dropzone__hint {
  font-size: 13px;
  color: #666 !important;
}

/* After choosing a file: solid border and the file name */
.upload-dropzone.has-file {
  border-style: solid;
  border-color: #008699;
}

.upload-dropzone__file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 50px;
  background: #fff;
  border: 1px solid #b9dde2;
  font-size: 14px;
  font-weight: 600;
  color: #1e8449;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.upload-dropzone__file[hidden] {
  display: none;
}

.hdt-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---- Consent ---- */
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 12px !important;
  line-height: 1.4 !important;
  text-align: left;
  color: #555 !important; /* calm grey instead of the theme's teal label colour */
  cursor: pointer;
}

.consent-label span,
.consent-label a {
  font-size: inherit !important;
  line-height: inherit !important;
}

.consent-label span {
  color: inherit !important;
}

.consent-label input[type="checkbox"] {
  flex: none;
  margin-top: 3px;
}

/* ---- "You already have a CV": only for visitors with a CV ---- */
.upload-replace-notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #f3dca4;
  font-size: 14px;
  line-height: 1.45;
  color: #5c4a14;
  text-align: center;
}

.upload-replace-notice[hidden] {
  display: none;
}

.upload-replace-notice a {
  color: #008699;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

/* ---- "This is not an application": a small grey line under the button ---- */
/* The icon flows with the text, so a wrapped line on a phone still looks tidy */
.upload-not-application {
  display: block;
  text-align: center;
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #666;
}

.upload-not-application strong {
  color: #444;
}

.upload-not-application__icon {
  display: inline-block;
  vertical-align: -3px;
  margin-right: 4px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #008699;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Upload button: teal pill, like the buttons of the create form ---- */
.upload-resume-form .upload-resume-button {
  background-color: #008699;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.upload-resume-form .upload-resume-button:hover:not(:disabled) {
  background-color: #007684;
}

.upload-resume-form .upload-resume-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 600px) {
  .upload-card {
    padding: 16px;
  }

  .upload-resume-form .upload-resume-button {
    width: 100%;
  }
}

#loading-spinner {
  transition: opacity 0.7s ease;
  text-align: center;
  margin-top: 20px;
}

/* Loading animation (pure CSS, replaces ai-loading.gif): two rings turning in opposite directions
   around a pulsing "AI spark", in the Headit teal. Same 180 x 180 px box as the old GIF. */
.hdt-ai-loader {
  position: relative;
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

/* faint full circle behind the outer ring */
.hdt-ai-loader::before {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  border: 6px solid rgba(0, 134, 153, 0.12);
}

.hdt-ai-loader__ring {
  position: absolute;
  border-radius: 50%;
  border: 6px solid transparent;
}

.hdt-ai-loader__ring--outer {
  inset: 30px;
  border-top-color: #008699;
  border-right-color: #008699;
  animation: hdt-ai-spin 2s cubic-bezier(0.5, 0.15, 0.5, 0.85) infinite;
}

.hdt-ai-loader__ring--inner {
  inset: 48px;
  border-bottom-color: #5bc3cf;
  border-left-color: #5bc3cf;
  animation: hdt-ai-spin 1.4s linear infinite reverse;
}

/* four-pointed star in the middle */
.hdt-ai-loader__spark {
  position: absolute;
  inset: 72px;
  background: #008699;
  clip-path: polygon(
    50% 0%,
    61% 39%,
    100% 50%,
    61% 61%,
    50% 100%,
    39% 61%,
    0% 50%,
    39% 39%
  );
  animation: hdt-ai-pulse 2s ease-in-out infinite;
}

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

@keyframes hdt-ai-pulse {
  0%,
  100% {
    transform: scale(0.75) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.1) rotate(45deg);
    opacity: 1;
  }
}

/* Visitors who asked their device for less motion: slower rings, no pulsing */
@media (prefers-reduced-motion: reduce) {
  .hdt-ai-loader__ring--outer {
    animation-duration: 4.2s;
  }
  .hdt-ai-loader__ring--inner {
    animation-duration: 3.4s;
  }
  .hdt-ai-loader__spark {
    animation: none;
  }
}

#loading-spinner-text {
  margin-top: 10px;
  line-height: 1.2;
  text-align: center;
  font-size: 16px;
  color: #666666;
}

#alternative-action-container {
  text-align: center;
  margin-top: 25px;
  transition: opacity 0.7s ease;
}

#or-separator {
  font-weight: bold;
  color: black;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

#go-to-create-btn {
  background-color: #008699;
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

#go-to-create-btn:hover {
  background-color: #007684;
}
