/* ==========================================================================
   Join the library (/join). Kept in its own file so theme.css rewrites
   can't wipe it. Loaded only by join.php via page_start(['css' => ...]).
   ========================================================================== */

/* ---------- Hero ---------- */
.join-banner { padding-bottom: 96px; }
.join-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.join-hero .lead { max-width: 600px; }
.join-hero .btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.join-facts { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.join-facts li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #fff; font-size: .9rem; font-weight: 600; }
.join-facts li .ico { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--o400, #FBBF24); color: var(--b900); stroke-width: 3; }

/* Member card illustration */
.join-card { position: relative; justify-self: center; width: min(100%, 400px); aspect-ratio: 1.586; padding: 22px 24px; border-radius: 22px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 100% 0%, rgba(251, 191, 36, .32), transparent 55%), linear-gradient(135deg, var(--b600), var(--b800) 60%, var(--b900));
  box-shadow: 0 40px 60px -30px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .12) inset;
  transform: rotate(-4deg); transition: transform .5s cubic-bezier(.2, .7, .2, 1); animation: joinFloat 6s ease-in-out infinite; }
.join-card:hover { transform: rotate(0) scale(1.02); }
.join-card::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; border: 28px solid rgba(255, 255, 255, .05); z-index: -1; }
.join-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .14) 45%, transparent 60%); background-size: 250% 100%; animation: joinShine 5s ease-in-out infinite; }
.join-card-top { display: flex; align-items: center; gap: 12px; }
.join-card-top img { width: 40px; height: 40px; border-radius: 10px; background: #fff; padding: 3px; }
.join-card-top strong { display: block; font-size: 1rem; letter-spacing: -.01em; color: #fff; }
.join-card-top small { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.join-card-top span { margin-left: auto; padding: 4px 12px; border-radius: 999px; background: var(--o400, #FBBF24); color: var(--b900); font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.join-card small { color: rgba(255, 255, 255, .65); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }
.join-card-mid strong { display: block; margin-top: 2px; font-size: 1.35rem; letter-spacing: -.02em; color: #fff; }
.join-card-bot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.join-card-bot strong { display: block; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 1.05rem; letter-spacing: .08em; color: #fff; }
.join-card-bars { width: 120px; height: 38px; border-radius: 6px; background: #fff; padding: 5px 7px;
  background-image: repeating-linear-gradient(90deg, var(--s900) 0 2px, transparent 2px 4px, var(--s900) 4px 5px, transparent 5px 8px, var(--s900) 8px 11px, transparent 11px 12px);
  background-clip: content-box; box-shadow: 0 0 0 5px #fff inset; }
@keyframes joinFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes joinShine { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }

/* ---------- Benefits & types ---------- */
.join-alt { background: #fff; border-block: 1px solid var(--s200); }
.join-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--b50); color: var(--b700); margin-bottom: 16px; transition: background .25s, color .25s, transform .25s; }
.join-ico .ico { width: 22px; height: 22px; }
.join-benefit { padding: 26px; }
.join-benefit:hover .join-ico { background: var(--b600); color: #fff; transform: rotate(-6deg); }
.join-benefit h3 { margin-bottom: 6px; font-size: 1.12rem; }
.join-benefit p { margin: 0; font-size: .95rem; }

.join-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.join-type { position: relative; padding: 26px 22px 22px; border-radius: 24px; background: var(--s50); border: 1px solid var(--s200); display: flex; flex-direction: column; transition: border-color .25s, box-shadow .25s, transform .25s; }
.join-type:hover { border-color: var(--b400); box-shadow: var(--shadow); transform: translateY(-4px); }
.join-type .join-ico { background: #fff; box-shadow: 0 0 0 1px var(--s200); }
.join-type h3 { font-size: 1.2rem; margin: 0 0 4px; }
.join-type::after { content: "Free"; position: absolute; top: 22px; right: 20px; padding: 3px 10px; border-radius: 999px; background: var(--o100); color: var(--o700); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.join-who { margin: 0 0 16px; color: var(--s500); font-size: .92rem; }
.join-bring { margin: auto 0 0; padding-top: 14px; border-top: 1px dashed var(--s300); font-size: .88rem; color: var(--s600); }
.join-bring strong { display: block; color: var(--s900); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }

/* ---------- Application layout ---------- */
.join-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(28px, 4vw, 48px); align-items: start; }
.join-form { max-width: none; }
.join-form .fs { border-radius: 24px; padding: 26px 28px 12px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); transition: border-color .25s, box-shadow .25s; }
.join-form .fs:focus-within { border-color: var(--b400); box-shadow: 0 0 0 4px rgba(22, 163, 74, .08); }
.join-form .fs legend { font-size: 1.08rem; color: var(--s900); }
.join-form .fs legend span.lg-plain { width: auto; height: auto; background: none; color: inherit; border-radius: 0; display: inline; font: inherit; }
.fs-note { margin: 0 0 18px; padding: 12px 14px; border-radius: 14px; background: var(--o50); border: 1px solid var(--o100); color: var(--o700); font-size: .9rem; }
.join-form .field { margin-bottom: 16px; }

/* Membership type picker */
.type-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.type-opt { position: relative; display: block; margin: 0; cursor: pointer; }
.type-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.type-opt > span { position: relative; height: 100%; display: flex; flex-direction: column; gap: 4px; padding: 16px 14px 14px; border: 1.5px solid var(--s200); border-radius: 18px; background: #fff; transition: border-color .2s, background .2s, box-shadow .2s, transform .2s; }
.type-opt > span .ico { width: 34px; height: 34px; padding: 7px; margin-bottom: 6px; border-radius: 10px; background: var(--s100); color: var(--s600); transition: background .2s, color .2s; }
.type-opt strong { color: var(--s900); font-size: 1rem; line-height: 1.2; }
.type-opt small { color: var(--s500); font-size: .8rem; line-height: 1.35; }
.type-opt > span::after { content: ""; position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--s300); background: #fff; transition: all .2s; }
.type-opt:hover > span { border-color: var(--b400); transform: translateY(-2px); }
.type-opt input:checked + span { border-color: var(--b600); background: var(--b50); box-shadow: 0 0 0 4px rgba(22, 163, 74, .12); }
.type-opt input:checked + span .ico { background: var(--b600); color: #fff; }
.type-opt input:checked + span::after { border-color: var(--b600); background: var(--b600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center/12px; }
.type-opt input:focus-visible + span { outline: 3px solid rgba(22, 163, 74, .45); outline-offset: 2px; }

/* Rules and consent */
.join-rules { margin: 0 0 18px; border: 1px solid var(--s200); border-radius: 18px; background: var(--s50); overflow: hidden; }
.join-rules summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-weight: 700; color: var(--s900); }
.join-rules summary::-webkit-details-marker { display: none; }
.join-rules summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--s500); border-bottom: 2px solid var(--s500); transform: rotate(45deg); transition: transform .25s; margin-top: -4px; }
.join-rules[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.join-rules ol { margin: 0; padding: 4px 22px 16px 42px; display: grid; gap: 8px; counter-reset: none; }
.join-rules li { color: var(--s700); font-size: .93rem; line-height: 1.55; padding-left: 4px; }
.join-rules li::marker { color: var(--b600); font-weight: 800; }
.join-check { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px; padding: 14px 16px; border: 1.5px solid var(--s200); border-radius: 16px; background: #fff; cursor: pointer; font-weight: 500; color: var(--s700); line-height: 1.5; transition: border-color .2s, background .2s; }
.join-check:hover { border-color: var(--b400); }
.join-check:has(input:checked) { border-color: var(--b600); background: var(--b50); }
.join-check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 2px solid var(--s300); border-radius: 7px; background: #fff; cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.join-check input:checked { border-color: var(--b600); background: var(--b600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center/13px; }
.join-check input:focus-visible { outline: 3px solid rgba(22, 163, 74, .45); outline-offset: 2px; }
.join-check span { font-size: .93rem; }
.join-check input[required] + span::after { content: " *"; color: var(--o600); font-weight: 700; }
.join-submit { width: 100%; justify-content: center; padding-block: 16px; font-size: 1.05rem; margin-top: 4px; }
.join-form .form-note { text-align: center; margin-top: 12px; }

/* Sidebar */
.join-side { position: sticky; top: 110px; display: grid; gap: 16px; }
.join-side-card { padding: 22px; border-radius: 24px; }
.join-side-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin: 0 0 10px; }
.join-side-card h3 .ico { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--b50); color: var(--b700); }
.join-side-card p { font-size: .93rem; margin: 0 0 10px; }
.join-side-card p:last-child { margin-bottom: 0; }
.join-side-card .muted { display: flex; gap: 8px; align-items: flex-start; color: var(--s500); }
.join-side-card .muted .ico { flex: none; margin-top: 2px; }
.join-hours { padding: 12px 14px; border-radius: 14px; background: var(--s50); border: 1px solid var(--s200); color: var(--s800) !important; font-weight: 600; font-size: .88rem !important; line-height: 1.7; }
.join-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.join-list li { position: relative; padding-left: 28px; font-size: .93rem; color: var(--s700); }
.join-list li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--b100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center/11px; }
.join-side-help { background: linear-gradient(150deg, var(--b700, #166534), var(--b900, #052E16)); border-color: transparent; }
.join-side-help h3, .join-side-help p { color: #fff; }
.join-side-help h3 .ico { background: rgba(255, 255, 255, .12); color: var(--o400, #FBBF24); }
.join-side-help a { color: var(--o400, #FBBF24); font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(251, 191, 36, .4); }
.join-side-help a:hover { border-color: var(--o400, #FBBF24); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .join-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .join-layout { grid-template-columns: 1fr; }
  .join-side { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 900px) {
  .join-hero { grid-template-columns: 1fr; }
  .join-card { width: min(100%, 360px); margin-top: 8px; }
  .type-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .join-banner { padding-bottom: 64px; }
  .join-types { grid-template-columns: 1fr; }
  .join-form .fs { padding: 20px 16px 6px; border-radius: 20px; }
  .type-opt > span { padding: 14px 12px 12px; }
  .type-opt small { font-size: .76rem; }
  .join-card { transform: rotate(-2deg); }
  .join-hero .btn-row .btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .join-card, .join-card::after { animation: none; }
}

/* Fixes: keep consent boxes square, keep paired fields aligned */
.join-form .join-check input[type="checkbox"] { width: 22px !important; height: 22px !important; min-width: 22px; min-height: 0 !important; padding: 0 !important; margin: 1px 0 0 !important; border-radius: 7px !important; box-shadow: none; }
.join-form .field > label .hint, .join-form .field > .label .hint { display: inline; margin: 0 0 0 6px; font-weight: 500; }
.join-form .row-2 { align-items: end; }

/* ===== 2026-11-10: progress, review, extra fields ===== */
.join-apply { padding-top: clamp(28px, 4vw, 48px); }
.join-progress { position: sticky; top: 88px; z-index: 5; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border: 1px solid var(--s200, #E2E8F0); border-radius: 18px; padding: 14px 18px; margin: 0 0 20px; box-shadow: 0 10px 28px -22px rgba(5, 46, 22, .45); }
.jp-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .86rem; color: var(--s600, #475569); margin-bottom: 8px; }
.jp-top strong { color: var(--s900, #0F172A); font-size: .92rem; }
.jp-bar { height: 6px; border-radius: 6px; background: var(--s100, #F1F5F9); overflow: hidden; }
.jp-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #16A34A, #F5A01A); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.jp-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.jp-steps a { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 10px; font-size: .78rem; font-weight: 600; color: var(--s600, #475569); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .2s, color .2s; }
.jp-steps a em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.jp-steps a span { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; font-size: .72rem; font-weight: 800; background: var(--s100, #F1F5F9); color: var(--s600, #475569); transition: background .2s, color .2s; }
.jp-steps a:hover { background: var(--s50, #F8FAFC); color: var(--s900, #0F172A); }
.jp-steps a.now { background: #ECFDF3; color: #14532D; }
.jp-steps a.done span { background: #16A34A; color: #fff; }
.jp-draft { margin: 10px 0 0; font-size: .78rem; color: var(--s500, #64748B); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.jp-draft button { border: 0; background: none; padding: 0; font: inherit; color: #B91C1C; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.join-form .fs { scroll-margin-top: 210px; }
#emergency .fs-note { background: #F0F7FF; border-color: #D6E6FB; color: #1E4E8C; }
.checks-inline { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

.join-review { margin: 4px 0 20px; padding: 20px 22px; border-radius: 20px; background: linear-gradient(180deg, #F7FBF8, #fff); border: 1px dashed #BFDCCB; }
.join-review h3 { margin: 0 0 12px; font-size: 1rem; display: flex; align-items: center; gap: 8px; color: var(--s900, #0F172A); }
.join-review dl { margin: 0; display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: 6px 16px; font-size: .88rem; }
.join-review dt { color: var(--s500, #64748B); }
.join-review dd { margin: 0; color: var(--s900, #0F172A); font-weight: 600; word-break: break-word; }

@media (max-width: 1100px) { .jp-steps a em, .jp-steps a { font-size: .74rem; } }
@media (max-width: 900px) {
  .join-progress { top: 72px; padding: 12px 14px; }
  .jp-steps { grid-template-columns: repeat(6, auto); justify-content: space-between; }
  .jp-steps a { padding: 4px; font-size: 0; gap: 0; }
  .jp-steps a span { font-size: .72rem; width: 26px; height: 26px; }
  .jp-steps a.now span { box-shadow: 0 0 0 3px rgba(22, 163, 74, .25); }
}
@media (max-width: 560px) { .join-review dl { grid-template-columns: 1fr; gap: 2px; } .join-review dd { margin-bottom: 8px; } }

/* phone fixes: let the form column shrink, compact step bar */
.join-layout > * { min-width: 0; }
@media (max-width: 1024px) { .join-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .jp-steps a em { display: none; }
  .jp-steps { grid-template-columns: repeat(6, minmax(0, 1fr)); justify-items: center; }
  .jp-steps a { justify-content: center; width: 100%; }
  .jp-top span { white-space: nowrap; }
  .jp-draft { font-size: .74rem; }
}
.join-form .row-2 > *, .join-form .field { min-width: 0; }
.join-form input, .join-form select, .join-form textarea { max-width: 100%; min-width: 0; }
.type-pick { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.jp-prog { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: #ECFDF3; color: #14532D; font-size: .82rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* passport photo and signature (membership card) */
.photo-field { margin-top: 4px; }
.photo-up { display: flex; gap: 18px; align-items: center; padding: 16px; border: 1.5px dashed var(--s300); border-radius: 18px; background: var(--s50, #f8faf9); transition: border-color .2s, background .2s; }
.photo-up:has(.photo-prev.has) { border-style: solid; border-color: var(--b600); background: var(--b50); }
.photo-prev { flex: none; width: 96px; height: 120px; border-radius: 14px; background: #fff; border: 1.5px solid var(--s200); display: grid; place-items: center; overflow: hidden; color: var(--s400, #9aa5a0); }
.photo-prev .ico { width: 40px; height: 40px; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-txt { min-width: 0; display: grid; gap: 4px; }
.photo-txt strong { color: var(--s900); font-size: 1rem; }
.photo-txt small { color: var(--s600, #5b6b63); line-height: 1.45; }
.photo-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 8px; }
.photo-pick { position: relative; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.photo-pick:focus-within { outline: 3px solid var(--b400); outline-offset: 2px; }
.photo-del { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--b700, #15803d); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.photo-err { margin: 6px 0 0; color: #b91c1c; font-size: .9rem; font-weight: 600; }
.sig-field { margin: 4px 0 18px; }
.sig-field .fs-note { margin: 2px 0 10px; }
.sig-pad { position: relative; border: 1.5px solid var(--s200); border-radius: 18px; background: #fff; overflow: hidden; touch-action: none; }
.sig-pad:focus-within, .sig-pad:hover { border-color: var(--b400); }
.sig-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 900 / 260; cursor: crosshair; touch-action: none; position: relative; z-index: 1; }
.sig-line { position: absolute; left: 6%; right: 6%; bottom: 26%; border-bottom: 1.5px dashed var(--s300); pointer-events: none; }
.sig-ph { position: absolute; left: 6%; bottom: calc(26% + 8px); color: var(--s400, #9aa5a0); font-weight: 600; pointer-events: none; }
.sig-upl { position: relative; }
@media (max-width: 560px) { .photo-up { flex-direction: column; align-items: flex-start; } .photo-prev { width: 88px; height: 110px; } }
.photo-pick { min-height: 44px; padding: 8px 18px; font-size: .95rem; }
/* [hidden] must win over the display rules above (the "Applying for" note and draft line were showing empty) */
.jp-prog[hidden], .jp-draft[hidden], .join-form [hidden] { display: none !important; }
.join-form .photo-btns .photo-pick { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; width: auto; font-weight: 600; color: var(--b700, #15803d); }
.join-form .photo-btns .photo-pick .ico { display: inline-block; margin: 0; }
.join-form .photo-btns .photo-del { margin: 0; display: inline; width: auto; }
