/* ==========================================================================
   Careers · 5 — Register your interest
   Builds on the contact form's styles (css/sections/contact.css: .contact,
   .ct-*) and adds what this form needs:
     - an "Other" field that appears under the area select
     - a CV drop zone: drop or browse; drag-over, file chip, error states
     - a note textarea with a character count
   Prefixed .ri- and scoped to .ri.
   ========================================================================== */

.ri { scroll-margin-top: var(--nav-height); }
.ri-mail { color: var(--accent-text); font-weight: 500; text-underline-offset: 3px; }
.ri-mail:hover { text-decoration-thickness: 2px; }

/* the select's placeholder reads as a placeholder until a choice is made */
.ri select:invalid { color: var(--text-muted); }
.ri select option { color: var(--text-primary); }
.ri .ct-field.is-invalid select,
.ri .ct-field.is-invalid textarea { border-color: var(--warn); }

/* ─── "Other": a field that opens under the select ────────────────────── */
.ri-other[hidden] { display: none; }
.ri-other.is-open { animation: ri-open 0.3s var(--ease-out); }
@keyframes ri-open { from { opacity: 0; transform: translateY(-6px); } }
.ri-other-in { display: flex; flex-direction: column; }

/* ─── Note ────────────────────────────────────────────────────────────── */
.ri textarea {
  display: block;
  width: 100%;
  min-height: 112px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--ct-input);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
.ri textarea::placeholder { color: var(--text-muted); }
.ri textarea:hover { border-color: var(--accent-line); }
.ri textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ri-count { margin-top: 6px; font-size: 12px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ri-count.is-near { color: var(--warn); }

/* ─── CV drop zone ────────────────────────────────────────────────────── */
.ri-label { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
/* CV: a mailto link can't carry a file, so the visitor attaches it in the email */
.ri-attach {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ri-attach .ti { flex: none; margin-top: 1px; font-size: 17px; color: var(--accent); }
.ri-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ri-drop { position: relative; }
.ri-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 16px;
  text-align: center;
  background: color-mix(in srgb, var(--surface-raised) 70%, var(--ct-input));
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease-out, transform 0.15s ease-out;
}
.ri-drop-zone .ti { font-size: 26px; color: var(--accent); transition: transform 0.25s var(--ease-out); }
.ri-drop-main { font-size: 14.5px; color: var(--text-secondary); }
.ri-drop-main b { font-weight: 600; color: var(--text-primary); }
.ri-drop-main u { color: var(--accent-text); text-underline-offset: 3px; }
.ri-drop-hint { font-size: 12.5px; color: var(--text-muted); }
.ri-drop-zone:hover { border-color: var(--accent-line); }
.ri-drop-zone:hover .ti { transform: translateY(-2px); }
.ri-file:focus-visible + .ri-drop-zone { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
/* a file dragged over the zone */
.ri-drop.is-over .ri-drop-zone { border-color: var(--accent); border-style: solid; background: var(--accent-soft); transform: scale(1.01); }
.ri-drop.is-over .ri-drop-zone .ti { transform: translateY(-4px); }
.ri .ct-field.is-invalid .ri-drop-zone { border-color: var(--warn); }

/* the chosen file */
.ri-drop[data-state="file"] .ri-drop-zone { display: none; }
.ri-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  background: var(--ct-input);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  animation: ri-pop 0.3s var(--ease-out);
}
.ri-chip[hidden] { display: none; }
@keyframes ri-pop { from { opacity: 0; transform: scale(0.97); } }
.ri-chip-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 19px; }
.ri-chip-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ri-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 500; color: var(--text-primary); }
.ri-chip-size { font-size: 12.5px; color: var(--text-muted); }
.ri-chip-x {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px; height: 36px;
  font-size: 17px;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}
.ri-chip-x:hover { color: var(--text-primary); background: var(--surface-raised); }
.ri-chip-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .ri-drop-zone, .ri-drop-zone .ti, .ri textarea { transition: none; }
  .ri-chip, .ri-other.is-open { animation: none; }
}
