/* FormHandler shared styles. Colours use CSS variables so each site can theme them. */
:root {
    --fh-accent: #1C2641;
    --fh-border: #c9ced8;
    --fh-error: #c62828;
}

/* Honeypot: hidden from people, visible to naive bots */
.fh-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Upload widget */
.fh-upload { position: relative; }
.fh-upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.fh-upload-drop {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 22px 16px; border: 2px dashed var(--fh-border); border-radius: 10px;
    background: #fff; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
    color: var(--fh-accent); width: 100%; margin: 0;
}
.fh-upload-drop:hover, .fh-upload.is-dragover .fh-upload-drop { border-color: var(--fh-accent); background: #f6f8fb; }
.fh-upload-input:focus-visible + .fh-upload-drop { outline: 3px solid rgba(28, 38, 65, .35); outline-offset: 2px; }
.fh-upload-title { font-weight: 600; font-size: 1.05em; }
.fh-upload-hint { font-size: .85em; color: #666; font-weight: normal; }
.fh-upload-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.fh-upload-list:empty { display: none; }
.fh-upload-item {
    position: relative; display: flex; flex-direction: column; gap: 6px;
    border: 1px solid var(--fh-border); border-radius: 8px; padding: 6px; background: #fff; font-size: .8em;
}
.fh-upload-item img { width: 100%; height: 100px; object-fit: cover; border-radius: 5px; display: block; }
.fh-upload-icon {
    display: flex; align-items: center; justify-content: center; height: 100px; border-radius: 5px;
    background: #eef1f6; color: var(--fh-accent); font-weight: 700;
}
.fh-upload-name { word-break: break-all; line-height: 1.3; color: #444; }
.fh-upload-remove {
    position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%;
    border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 18px; line-height: 28px; padding: 0; cursor: pointer;
}
.fh-upload-remove:hover { background: var(--fh-error); }
.fh-upload-error { color: var(--fh-error); font-size: .9em; margin-top: 6px; }
.fh-upload-error:empty { display: none; }

/* Busy submit button */
button[aria-busy="true"], input[aria-busy="true"] { cursor: progress; opacity: .75; }

/* reCAPTCHA v2 */
.fh-recaptcha-wrap { margin: 10px 0; }
.fh-recaptcha-error { color: var(--fh-error); font-size: .9em; margin-top: 6px; }
.fh-recaptcha-error:empty { display: none; }

/* =====================================================================
 |  Error summary (1.2.1)
 |  The "Please check the highlighted fields" box above the submit button,
 |  from $fh->summary() (or an older div.errorStrip / div.error strip that
 |  form-handler.js has taken over):
 |
 |    <div class="fh-summary alert alert-danger" role="alert" data-fh-summary hidden></div>
 |
 |  .fh-summary.fh-summary doubles the specificity so these rules beat
 |  Bootstrap 3 and 5's .alert / .alert-danger and most skin CSS, whatever
 |  order the stylesheets load in: the box looks the same on every site,
 |  including sites without Bootstrap.
 * ===================================================================== */
.fh-summary.fh-summary {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-sizing: border-box;
    width: 100%;
    margin: 15px 0;
    padding: 12px 15px;
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f1aeb5;
    border-left: 4px solid #dc3545;
    border-radius: 6px;
    box-shadow: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: normal;
    line-height: 1.45;
    text-align: left;
    text-shadow: none;
}
.fh-summary.fh-summary[hidden] { display: none; }

/* Warning icon (inline SVG, so no icon font is needed) */
.fh-summary .fh-summary-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    fill: currentColor;
}
.fh-summary .fh-summary-body { flex: 1 1 auto; min-width: 0; }
.fh-summary .fh-summary-title {
    display: block;
    margin: 0;
    font-weight: bold;
    color: inherit;
}

/* List of the fields to fix, each a link to the field */
.fh-summary .fh-summary-list {
    margin: 6px 0 0;
    padding: 0 0 0 18px;
    list-style: disc;
    list-style-image: none;
}
.fh-summary .fh-summary-list li {
    margin: 2px 0;
    padding: 0;
    background: none;
    color: inherit;
}
.fh-summary .fh-summary-list a {
    color: inherit;
    font-weight: normal;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.fh-summary .fh-summary-list a:hover,
.fh-summary .fh-summary-list a:focus {
    color: #58151c;
    text-decoration: none;
}

/* Brief fade in when it appears */
@keyframes fh-summary-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
.fh-summary.fh-summary.fh-summary-show { animation: fh-summary-in .2s ease-out; }
@media (prefers-reduced-motion: reduce) {
    .fh-summary.fh-summary.fh-summary-show { animation: none; }
}

/* Phones: a little tighter */
@media (max-width: 575px) {
    .fh-summary.fh-summary {
        padding: 10px 12px;
        font-size: 14px;
    }
}
