/* ID photo field and status; the plugin loads this only with a form from IPDML_FORM_IDS.
   Label, upload button, help and error use Fluent Forms' own classes; this styles only the rest.
   See docs/id-photo-mailer.md › *Twee kolommen: foto links, de rest rechts*. */
.ipdml-photo-input { display: none; }
.ipdml-photo-file-name { margin-left: 10px; }
.ipdml-photo-file-name:empty { display: none; }
/* A passport photo is 35 × 45 mm; cover fills the frame, the mail still holds the whole photo. */
.ipdml-photo-preview {
  display: block;
  box-sizing: border-box;
  width: 140px;
  height: 180px;
  margin-top: 8px;
  border: 1px solid #c9ced6;
  border-radius: 6px;
  background: #ffffff;
  object-fit: cover;
  cursor: grab;
  touch-action: none;
}
.ipdml-photo-preview:active { cursor: grabbing; }
.ipdml-photo-preview:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.ipdml-photo-pan-hint { max-width: 140px; }
.ipdml-photo-status { margin-top: 8px; }
.ipdml-photo-status--success { color: #1a7f37; }
.ipdml-photo-status--error { color: #b42318; }

/* The 1fr row takes up the frame's height, so the right column stays packed at the top. */
.ipdml-photo-field {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto 1fr auto;
  grid-template-areas:
    "label label"
    "photo hint"
    "photo control"
    "photo error"
    "photo help"
    "photo ."
    "pan .";
  column-gap: 24px;
}
.ipdml-photo-field > .ff-el-input--label { grid-area: label; }
.ipdml-photo-field > .ipdml-photo-hint { grid-area: hint; margin: 0 0 12px; }
.ipdml-photo-field > .ff-el-help-message:not(.ipdml-photo-hint) { grid-area: help; margin-top: 12px; }
/* The wrapper's children (button, preview, error) take their own place in the grid. */
.ipdml-photo-field > #ipdml_photo_input_wrapper { display: contents; }
.ipdml-photo-field .ff_file_upload_holder { grid-area: control; }
.ipdml-photo-field .error { grid-area: error; }
.ipdml-photo-field .ipdml-photo-preview { grid-area: photo; margin-top: 0; }
.ipdml-photo-field .ipdml-photo-pan-hint { grid-area: pan; margin-top: 6px; }
/* The empty frame with a silhouette in passport framing: the head large, the shoulders running off
   the sides. Not repeated and only inside the border, or a repeated shoulder shows under the dashes;
   the preview covers it once a photo is chosen. */
.ipdml-photo-field > #ipdml_photo_input_wrapper::before {
  content: "";
  grid-area: photo;
  box-sizing: border-box;
  width: 140px;
  height: 180px;
  border: 2px dashed #9aa2ad;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 42%, #b9c0c9 0 40px, transparent 41px) no-repeat,
    radial-gradient(ellipse 80px 72px at 50% 108%, #b9c0c9 0 98%, transparent 100%) no-repeat,
    #ffffff;
  background-clip: padding-box;
}

@media (max-width: 479px) {
  .ipdml-photo-field {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "label" "hint" "photo" "pan" "control" "error" "help";
  }
  .ipdml-photo-field > #ipdml_photo_input_wrapper::before { margin-bottom: 12px; }
  .ipdml-photo-field .ipdml-photo-pan-hint { margin: 0 0 12px; }
}
