/* ===========================================================================
 * "Confirm Volunteering" — the sheet behind Join this event.
 *
 * Deliberately NOT scoped to one page. view/feed/feedAction.php is loaded into
 * six different modals (live-feed, eng-feed, live-profile, live-profile-detail,
 * view-profile, profile-individual) and it should look the same in all of them.
 * Four of those gave .modal-content the class bg-black text-white and two left
 * it light, which is how the sheet ended up as white text on white; the shell
 * is normalised here so the partial only has to be right once.
 *
 * Colours come from the tokens all-css.php emits for the signed-in user's
 * employer, so this screen is the client's colour like everything else.
 * =========================================================================== */

#confirmVolPopup .modal-dialog {
    width: 460px;
    max-width: calc(100vw - 32px);
}

/* Light, whatever the host page put on it. */
#confirmVolPopup .modal-content {
    background: var(--lf-surface, #fff) !important;
    color: var(--lf-ink, #131a18) !important;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px -20px rgba(16, 23, 29, .45);
}

/* --- the header band ----------------------------------------------------
 * It was .bg-black: a black bar carrying a title that Bootstrap's .close then
 * painted #000 at 20% opacity on top of, so the bar looked empty and there was
 * no visible way out of the dialog but the backdrop. Now the client's colour,
 * with both the title and the close drawn in the ink that reads on it.
 * --------------------------------------------------------------------- */
#confirmVolPopup .modal-header {
    background: var(--lf-accent, #0c7a55) !important;
    border-bottom: 0;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#confirmVolPopup .modal-header .modal-title {
    /* The markup prints the close button before the title. That was fine while
       the close floated right; as a flex row it put the X on the left, where it
       reads as a back arrow. Ordered here rather than by editing the six pages
       that carry this header. */
    order: 1;
    flex: 1 1 auto;
    margin: 0;
    color: var(--lf-accent-ink, #fff);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    line-height: 1.3;
}

#confirmVolPopup .modal-header .close {
    order: 2;
    flex: 0 0 auto;
    float: none;
    margin: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    /* Tinted from the ink, not hardcoded white: Reliance's band is gold and
       carries DARK ink, so a white wash would have been invisible on it. */
    background: color-mix(in srgb, var(--lf-accent-ink, #fff) 16%, transparent);
    color: var(--lf-accent-ink, #fff);
    opacity: 1;
    font-size: 19px;
    line-height: 1;
    text-shadow: none;
    transition: background-color .15s ease;
}
#confirmVolPopup .modal-header .close:hover,
#confirmVolPopup .modal-header .close:focus {
    background: color-mix(in srgb, var(--lf-accent-ink, #fff) 30%, transparent);
    color: var(--lf-accent-ink, #fff);
    opacity: 1;
}

/* A tall event — hero, summary, five facts — ran past the bottom of a laptop
   screen and took Confirm with it. The detail scrolls; the decision does not. */
#confirmVolPopup .modal-body {
    padding: 0;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* --- the sheet ---------------------------------------------------------- */
.vcSheet {
    margin: 0;
    color: var(--lf-ink, #131a18);
    text-align: left;
    font-size: 14px;
    line-height: 1.55;
}
.vcSheet .vcNote { padding: 22px 20px; color: var(--lf-ink-2, #4e5b57); margin: 0; }
.vcSheet--error { padding: 24px 20px 0; }
.vcSheet--error .vcTitle { margin-bottom: 8px; }
.vcSheet--error p { margin: 0; color: var(--lf-ink-2, #4e5b57); }
.vcSheet--error .vcActions { border-top: 0; padding-left: 0; padding-right: 0; }

/* The event, shown rather than described. */
.vcHero {
    margin: 0;
    height: 160px;
    background: var(--lf-raise, #f1f4f3);
    overflow: hidden;
}
.vcHero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.vcHead { padding: 16px 20px 0; }

.vcKind {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--lf-kind-bg, #f1f3f5);
    color: var(--lf-ink-2, #4e5b57);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* The old sheet set every line at the same thin weight, so nothing led. */
.vcTitle {
    margin: 0;
    font-size: 19px;
    font-weight: 650;
    line-height: 1.3;
    color: var(--lf-ink, #131a18);
    text-transform: none;
}
.vcHost { margin: 5px 0 0; font-size: 13px; color: var(--lf-ink-3, #5e6b66); }
.vcSummary { margin: 10px 0 0; padding: 0 20px; color: var(--lf-ink-2, #4e5b57); }

/* --- the facts ---------------------------------------------------------- */
.vcFacts {
    list-style: none;
    margin: 16px 0 0;
    padding: 14px 20px;
    border-top: 1px solid var(--lf-line-soft, #ebefed);
    border-bottom: 1px solid var(--lf-line-soft, #ebefed);
    background: var(--lf-raise, #f1f4f3);
}
.vcFacts li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 5px 0;
    font-size: 13.5px;
    color: var(--lf-ink, #131a18);
}
.vcFacts li > em {
    flex: 0 0 16px;
    margin-top: 3px;
    font-size: 13px;
    color: var(--lf-accent-strong, #0c7a55);
    text-align: center;
}
.vcFacts li > span { flex: 1 1 auto; min-width: 0; }
.vcFact--place > span { word-break: break-word; }

.vcDirections {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-left: 8px;
    padding: 3px 10px;
    border: 1px solid var(--lf-accent-line, #bad9cf);
    border-radius: 999px;
    background: var(--lf-surface, #fff);
    color: var(--lf-accent-strong, #0c7a55);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}
.vcDirections:hover,
.vcDirections:focus {
    background: var(--lf-accent-bg, #e6f1ee);
    color: var(--lf-accent-strong, #0c7a55);
    text-decoration: none;
}

.vcMore {
    color: var(--lf-ink-3, #5e6b66);
    border-bottom: 1px dotted var(--lf-ink-3, #5e6b66);
    cursor: help;
}

/* Lives inside .vcActions and takes the free space, pushing the buttons right. */
.vcWho {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.35;
    color: var(--lf-ink-3, #5e6b66);
}
.vcWho b { color: var(--lf-ink, #131a18); font-weight: 650; }

/* --- actions ------------------------------------------------------------ */
.vcActions {
    position: sticky;
    bottom: 0;
    background: var(--lf-surface, #fff);
    border-top: 1px solid var(--lf-line-soft, #ebefed);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 16px;
}
.vcBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 104px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: filter .15s ease, background-color .15s ease;
}
.vcBtn--ghost {
    background: var(--lf-surface, #fff);
    border: 1px solid var(--lf-line, #dfe5e2);
    color: var(--lf-ink-2, #4e5b57);
}
.vcBtn--ghost:hover { background: var(--lf-raise, #f1f4f3); }
.vcBtn--primary {
    background: var(--lf-action, var(--lf-accent, #0c7a55));
    border: 1px solid var(--lf-action, var(--lf-accent, #0c7a55));
    color: var(--lf-action-ink, #fff);
}
.vcBtn--primary:hover:not([disabled]) { filter: brightness(1.08); }
.vcBtn[disabled] { opacity: .6; cursor: default; }

.vcSpin {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: vcSpin .7s linear infinite;
}
@keyframes vcSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .vcSpin { animation: none; }
}

@media (max-width: 480px) {
    .vcHero { height: 128px; }
    /* Stacked: who first, then the buttons side by side under it. */
    .vcActions { flex-wrap: wrap; }
    .vcWho { flex: 1 0 100%; margin-bottom: 4px; }
    .vcBtn { flex: 1 1 0; min-width: 0; }
}

/* ===========================================================================
 * "You are in" — the confirmation after a sign-up (#successModal).
 * Same family as the sheet above, deliberately smaller and quieter: it is a
 * receipt, not a decision.
 * =========================================================================== */
#successModal .modal-dialog { width: 380px; max-width: calc(100vw - 32px); }

#successModal .modal-content.vcDone {
    position: relative;
    border: 0;
    border-radius: 16px;
    background: var(--lf-surface, #fff);
    box-shadow: 0 24px 60px -20px rgba(16, 23, 29, .45);
    text-align: center;
}
#successModal .modal-body { padding: 30px 26px 26px; }

#successModal .vcDone-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--lf-ink-3, #5e6b66);
    opacity: 1;
    font-size: 20px;
    line-height: 1;
    text-shadow: none;
}
#successModal .vcDone-close:hover { background: var(--lf-raise, #f1f4f3); opacity: 1; }

/* The tick was a 100px PNG. Drawn instead, so it takes the client's colour. */
#successModal .vcDone-tick {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lf-accent-bg, #e6f1ee);
    color: var(--lf-accent-strong, #0c7a55);
    font-size: 24px;
    animation: vcPop .34s cubic-bezier(.2, 1.3, .4, 1) both;
}
@keyframes vcPop {
    from { transform: scale(.7); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

#successModal .vcDone-title {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    color: var(--lf-ink, #131a18);
}
#successModal .vcDone-event {
    margin: 6px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--lf-accent-strong, #0c7a55);
    line-height: 1.35;
}
#successModal .vcDone-event:empty { display: none; }
#successModal .vcDone-note {
    margin: 10px 0 20px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--lf-ink-2, #4e5b57);
}
#successModal .vcDone-cta { width: 100%; }

@media (prefers-reduced-motion: reduce) {
    #successModal .vcDone-tick { animation: none; }
}

/* Only one of the two confirmation notes is shown. .lfNoPost is put on the
   modal when the sign-up's feed row did not land in this viewer's feed. */
#successModal .vcDone-note--offFeed { display: none; }
#successModal.lfNoPost .vcDone-note--onFeed { display: none; }
#successModal.lfNoPost .vcDone-note--offFeed { display: block; }
#successModal.lfNoPost .vcDone-cta { display: none; }
