/* ===========================================================================
   Lead form — status line and honeypot.

   The form itself reuses the existing .cf-* card styling from
   SchoolCMS.Web.style.css (.cf-field / .cf-line / .cf-label / .cf-select /
   .cf-textarea / .cf-submit), so only the two pieces that stylesheet has no
   rules for live here.
   =========================================================================== */

/* Status line under the submit button. Empty until the script writes to it, so
   it must not reserve space or leave a gap in the card. */
.contact-card-form .cf-msg {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  min-height: 0;
}

.contact-card-form .cf-msg:empty {
  display: none;
}

.contact-card-form .cf-msg.is-error {
  color: #d92d20;
}

.contact-card-form .cf-msg.is-success {
  color: #067647;
}

/* Honeypot. The field also carries an inline position/left so it stays hidden
   even if this stylesheet fails to load — a visible honeypot would collect real
   answers from real people and get their enquiries rejected as spam. */
.contact-card-form .cf-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* The blog sidebar form sits on a dark navy card, where the default red/green
   status colours are too dark to read. */
.blog-form.contact-card-form .cf-msg.is-error {
  color: #ffb4ab;
}

.blog-form.contact-card-form .cf-msg.is-success {
  color: #86efac;
}

/* Submitting state: keep the button's footprint but make it clearly inert. */
.contact-card-form .bf-submit[disabled],
.contact-card-form .cf-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- Thank-you modal ------------------------------------------------------
   Shown by SchoolCMS.Web.leadform.js after a successful enquiry, so the
   confirmation cannot be missed below the fold. Matches the CMS contact
   form's modal. The accent follows --site-accent when a skin sets one. */

.lf-thanks {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.lf-thanks.is-open {
    display: flex;
    animation: lf-thanks-fade .2s ease-out;
}

.lf-thanks-box {
    --lf-accent: var(--site-accent, #16a34a);
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem 2rem;
    border-radius: 18px;
    background: #fff;
    text-align: center;
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35), 0 8px 20px -8px rgba(15, 23, 42, .2);
    animation: lf-thanks-pop .28s cubic-bezier(.2, .9, .3, 1.2);
}

.lf-thanks-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.lf-thanks-close:hover,
.lf-thanks-close:focus-visible {
    background: #f1f5f9;
    color: #0f172a;
}

.lf-thanks-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--lf-accent) 14%, #fff);
    color: var(--lf-accent);
}

.lf-thanks-icon svg {
    width: 38px;
    height: 38px;
}

.lf-thanks-title {
    margin: 0 0 .6rem;
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.lf-thanks-body {
    margin: 0 0 .4rem;
    color: #475569;
    font-size: 1rem;
    line-height: 1.6;
}

.lf-thanks-ref {
    margin: 0 0 1.5rem;
    color: #64748b;
    font-size: .9rem;
}

.lf-thanks-ref:empty {
    margin-bottom: 1.1rem;
}

.lf-thanks-ok {
    min-width: 140px;
    padding: .65rem 2rem;
    border: 0;
    border-radius: 999px;
    background: var(--lf-accent);
    color: #fff;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease;
}

.lf-thanks-ok:hover,
.lf-thanks-ok:focus-visible {
    filter: brightness(.92);
    transform: translateY(-1px);
}

@keyframes lf-thanks-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lf-thanks-pop {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
    .lf-thanks-box { padding: 2.25rem 1.25rem 1.5rem; border-radius: 16px; }
    .lf-thanks-title { font-size: 1.25rem; }
    .lf-thanks-ok { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .lf-thanks.is-open,
    .lf-thanks-box { animation: none; }
}
