/* Gift of Life Young Professionals - shared form styles (Join / Donate / Attend / Sponsor / Contact) and thank-you pages.
   Field colors follow the Figma "Form Fields" variables; the hover / focus / error states are the site's orange / red. */
:root {
    --field-border: #ffd166;      /* Form Fields/Border, Beige/600 */
    --field-fill: rgba(255,255,255,.3); /* Form Fields/Fill */
    --field-placeholder: #b1a7f5; /* Form Fields/Placeholder */
    --field-checked: #ffb505;     /* radio / checkbox fill (Wizard/Text - Inactive) */
    --beige-300: #fbf1d9;
    --beige-400: #faefd4;
    --lavender: #adaef6;          /* Primary Color Scheme/Border */
    --lavender-100: #e8e8fc;
    --gol-orange: #f25824;
    --gol-orange-50: #fbeee9;
    --error: #d92d20;
    --error-bg: #fdecea;
}

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.yp-form [hidden], .form-page [hidden] { display: none !important; }

/* ---- page title with divider lines ("Your gift will help / Save Lives") */
.title-lines { display: flex; align-items: center; gap: 10px; padding: 40px 40px 10px; }
.title-lines::before, .title-lines::after { content: ''; flex: 1 1 0; border-top: 1px solid var(--lavender); }
.title-lines .titles { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0 40px; text-align: center; color: var(--navy); }
.title-lines .eyebrow { font-size: 20px; line-height: 1; }
.title-lines h1, .title-lines h2 { font-size: 48px; }

/* ---- photo heroes of the form pages (400px on desktop; the photo sits above the title on phones, see site.css) */
.hero.hero-form { min-height: 400px; }
.hero-form .kicker { margin-bottom: 10px; font-size: 18px; font-weight: 700; line-height: 1.5; text-transform: uppercase; }
.hero-join { background-image: url('/res/img/bg-hero-join.webp'); }
.hero-join .hero-photo { background-image: url('/res/img/bg-hero-join.webp'); background-position: 30% center; }
.hero-booth { background-image: url('/res/img/hero-join-thank-you.webp'); }
.hero-booth .hero-photo { background-image: url('/res/img/hero-join-thank-you-mobile.webp'); }
/* Join thank-you: the title stays over the photo on phones too */
.hero-ty { background-image: url('/res/img/hero-join-thank-you.webp'); }

/* ---- form card */
.form-section { padding: 40px 100px 80px; }
.form-module { max-width: 1166px; margin: 0 auto; overflow: hidden; border: 1px solid var(--beige-border); border-radius: var(--radius-md); background: var(--beige-50); box-shadow: 0 4px 4px rgba(0,0,0,.25); }
.form-title { padding: 30px 20px 20px; background: var(--navy); text-align: center; }
.form-title h2 { color: #fff; }
.form-content { padding: 0 40px 20px; }
.form-content.padded { padding-top: 64px; }
.form-headline { padding: 40px 0 10px; border-bottom: 1px solid var(--beige-border); text-align: center; }
.form-headline h3 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.3; text-transform: uppercase; color: var(--navy); }
.form-band { margin-top: 0; padding: 20px 10px 10px; border-radius: var(--radius-md); background: var(--navy); text-align: center; }
.form-band h3 { margin: 0; font: 400 40px/1 var(--font-display); color: #fff; }
.form-subtitle { padding: 0 40px 15px; }
.form-subtitle h4 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1; color: var(--navy); }
.form-text { padding: 0 40px 30px; font-size: 18px; line-height: 1.5; color: #000; }
.form-block + .form-block { margin-top: 0; }
.form-gap { height: 49px; }
.form-gap.small { height: 20px; }
.btn-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 0; border-top: 1px solid var(--beige-border); }
.btn-wrap.no-line { border-top: 0; }
.btn-wrap .btn { gap: 12px; }
.btn-wrap .btn svg { flex: none; }
.btn-wrap .btn-primary { padding: 12px 24px; }
.btn-back { padding: 20px; border: 0; background: none; font: 400 20px/1 var(--font-body); text-transform: uppercase; color: var(--orange); cursor: pointer; text-decoration: none; transition: color .2s; }
.btn-back:hover, .btn-back:focus-visible { color: var(--orange-300); }
.btn-outline { background: none; border-color: var(--orange); color: var(--orange); }
.btn-outline:hover, .btn-outline:focus-visible { border-color: var(--orange-300); color: var(--orange-300); }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: wait; }

/* general (non-field) errors, e.g. a declined card */
.form-errors { margin: 20px 40px 0; padding: 15px 20px; border: 1px solid var(--error); border-radius: var(--radius-md); background: var(--error-bg); color: var(--error); font-weight: 700; text-align: center; }
.form-errors ul { margin: 0; padding: 0; list-style: none; }
.form-errors.validation-summary-valid { display: none; }

/* ---- field rows: two columns, 40px apart */
.fields { display: flex; gap: 40px; padding: 15px 40px; }
.fields > .fld { flex: 1 1 0; min-width: 0; }
.fields.narrow { padding-left: 140px; padding-right: 140px; }

/* ---- text input / select / textarea, with the label as placeholder that floats up once there's a value */
.fld { position: relative; }
.fld input:not([type=radio]):not([type=checkbox]):not([type=file]), .fld select, .fld textarea {
    display: block; width: 100%; height: 60px; margin: 0; padding: 20px 12px 8px; border: 1px solid var(--field-border); border-radius: var(--radius-sm);
    background: var(--field-fill); box-shadow: inset 0 4px 4px rgba(0,0,0,.15); font: 400 16px/1.5 var(--font-body); color: var(--body-text);
    -webkit-appearance: none; appearance: none; transition: border-color .2s, box-shadow .2s; }
.fld textarea { height: 180px; padding-top: 12px; resize: vertical; }
.fld > label { position: absolute; left: 13px; top: 18px; right: 13px; overflow: hidden; font: 400 16px/1.5 var(--font-body); color: var(--field-placeholder); white-space: nowrap; text-overflow: ellipsis; pointer-events: none; transition: top .15s, font-size .15s, color .15s; }
.fld .tag { position: absolute; left: 13px; top: 9px; font: 400 10px/1.5 var(--font-body); text-transform: uppercase; color: var(--body-text); pointer-events: none; }
/* filled / focused: the label becomes the small caption at the top */
.fld.filled > label, .fld:focus-within > label { top: 9px; font-size: 10px; text-transform: uppercase; color: var(--body-text); }
/* fields with a fixed caption (OPTIONAL / COUNTRY / EXP. MONTH ...): the label stays a placeholder, under the caption, until there's a value */
.fld.has-tag > label, .fld.has-tag:focus-within > label { top: 26px; font-size: 16px; text-transform: none; color: var(--field-placeholder); }
.fld.has-tag.filled > label { visibility: hidden; }
.fld textarea + label { top: 12px; }
.fld.filled textarea + label, .fld:focus-within textarea + label { visibility: hidden; }
/* states */
.fld input:hover, .fld select:hover, .fld textarea:hover { border-color: var(--mustard); }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--orange); box-shadow: inset 0 4px 4px rgba(0,0,0,.15), 0 0 0 3px rgba(255,130,0,.18); }
.fld input:disabled, .fld select:disabled, .fld textarea:disabled { opacity: .55; cursor: not-allowed; }
.fld .input-validation-error, .fld.error input, .fld.error select, .fld.error textarea { border-color: var(--error); }
.fld .input-validation-error:focus, .fld.error input:focus, .fld.error select:focus { box-shadow: inset 0 4px 4px rgba(0,0,0,.15), 0 0 0 3px rgba(217,45,32,.18); }
/* phone (masked-phone.js): the country code and number boxes look like one field, split by a vertical line */
.fld .masked-phone { display: flex; height: 60px; border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--field-fill);
    box-shadow: inset 0 4px 4px rgba(0,0,0,.15); transition: border-color .2s, box-shadow .2s; }
.fld .masked-phone:hover { border-color: var(--mustard); }
.fld .masked-phone:focus-within { border-color: var(--orange); box-shadow: inset 0 4px 4px rgba(0,0,0,.15), 0 0 0 3px rgba(255,130,0,.18); }
.fld .masked-phone > input.cc[type=text], .fld .masked-phone > input.num[type=text] { height: 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.fld .masked-phone > input.cc[type=text] { flex: none; width: 64px; padding: 14px 4px; border-right: 1px solid var(--field-border); text-align: center; color: var(--navy); transition: padding .15s; }
/* the code lines up with the placeholder while empty, and with the typed number (under the floated label) once focused / filled */
.fld-phone.filled .masked-phone > input.cc[type=text], .fld-phone:focus-within .masked-phone > input.cc[type=text] { padding: 20px 4px 8px; }
.fld .masked-phone > input.num[type=text] { flex: 1 1 0; min-width: 0; }
.fld-phone > label { left: 77px; } /* over the number box, clear of the country code */
.fld.error .masked-phone { border-color: var(--error); }
.fld.error .masked-phone:focus-within { box-shadow: inset 0 4px 4px rgba(0,0,0,.15), 0 0 0 3px rgba(217,45,32,.18); }
.field-error { display: block; margin-top: 5px; font-size: 14px; line-height: 1.4; color: var(--error); }
.field-error:empty, .field-error.field-validation-valid { display: none; }
.field-error.center { text-align: center; }
/* selects: arrow on the right; "Select one..." in placeholder color */
.fld select { padding-right: 44px; cursor: pointer; background: var(--field-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%2305021d' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") right 12px center / 24px no-repeat; }
.fld.chevron select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%2305021d' d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E"); }
.fld select.empty { color: var(--field-placeholder); }
.fld.fld-select:not(.has-tag):not(.filled) select { color: transparent; }
.fld select option { color: var(--body-text); }
.fld.invisible { visibility: hidden; }
/* icons inside fields */
.fld.has-icon input { padding-left: 48px !important; }
.fld.has-icon > label { left: 48px; }
.fld-icon { position: absolute; left: 12px; top: 18px; color: var(--field-placeholder); pointer-events: none; }
.fld.has-help input { padding-right: 48px !important; }
.fld.has-icon-right input { padding-right: 48px !important; }
.fld .icon-right { position: absolute; right: 12px; top: 18px; color: var(--navy); pointer-events: none; }
.help-tip { position: absolute; right: 10px; top: 16px; padding: 2px; border: 0; background: none; color: var(--field-placeholder); cursor: help; }
.help-tip:hover, .help-tip:focus-visible { color: var(--orange); outline: none; }
.help-tip .tip { position: absolute; z-index: 5; right: -6px; bottom: calc(100% + 8px); width: 260px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--navy); color: #fff;
    font: 400 13px/1.4 var(--font-body); text-align: left; box-shadow: 0 4px 8px rgba(0,0,0,.2); opacity: 0; visibility: hidden; transition: opacity .15s; }
.help-tip:hover .tip, .help-tip:focus .tip { opacity: 1; visibility: visible; }
/* money inputs: a "$" in front */
.fld.money { width: 250px; flex: none; }
.fld.money.small { width: 150px; }
.fld.money::before { content: '$'; position: absolute; left: 13px; top: 26px; font: 400 16px/1.5 var(--font-body); color: var(--field-placeholder); pointer-events: none; }
.fld.money.filled::before { color: var(--body-text); }
.fld.money input { padding-left: 26px !important; }
.fld.money > label { left: 13px; }
.fld.money:not(.has-tag) input { padding-top: 12px !important; padding-bottom: 12px !important; }
.fld.money:not(.has-tag)::before { top: 17px; }
.fld.money input[readonly] { cursor: default; }

/* ---- radios / checkboxes (real inputs, restyled) */
.rb, .cb { flex: none; width: 18px; height: 18px; margin: 0; border: 1px solid var(--field-border); background: #fff; box-shadow: inset 0 3px 4px rgba(0,0,0,.15);
    -webkit-appearance: none; appearance: none; cursor: pointer; transition: border-color .2s, background-color .2s; }
.rb { border-radius: 50%; }
.cb { border-radius: 3px; }
.rb:checked { background: radial-gradient(circle, #fff 0 4px, var(--field-checked) 4.5px); box-shadow: none; }
.cb:checked { border-color: var(--field-checked); background: var(--field-checked) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: none; }
.rb:hover, .cb:hover { border-color: var(--orange); }
.rb:focus-visible, .cb:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.rb:disabled, .cb:disabled { opacity: .5; cursor: not-allowed; }
.choice { display: inline-flex; align-items: center; gap: 12px; font-size: 16px; line-height: 1.5; color: #000; cursor: pointer; }
.choice.lg { font-size: 18px; }
.vgroup.error .rb, .vgroup.error .cb { border-color: var(--error); }

/* two-column lists of radios / checkboxes (chapters, interests) */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; row-gap: 30px; padding: 40px 40px 40px; }
.choice-grid.tight { row-gap: 20px; padding-top: 30px; padding-bottom: 30px; }
.vgroup > .field-error { padding: 0 40px 20px; }

/* ---- toggle switch */
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; line-height: 1.5; color: #000; cursor: pointer; }
.tgl { position: relative; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 500px; background: #cfcbe6; -webkit-appearance: none; appearance: none; cursor: pointer; transition: background-color .2s; }
.tgl::before { content: ''; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.tgl:checked { background: var(--navy); }
.tgl:checked::before { left: 20px; }
.tgl:hover { background-color: #b1a7f5; }
.tgl:checked:hover { background-color: #1b0f80; }
.tgl:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.toggle-row { padding: 0 40px 40px; }

/* ---- label / value rows (payment summary, donation amount, sponsorship total) */
.calc { padding: 0 100px; }
.calc.pad-top { padding-top: 20px; }
.calc.pad-bottom { padding-bottom: 64px; }
.calc-row { display: flex; gap: 40px; align-items: center; padding: 15px 40px; }
.calc-row.top { align-items: flex-start; padding-top: 30px; }
.calc-row.lined { border-top: 1px solid var(--beige-border); padding-top: 20px; padding-bottom: 20px; }
.calc-row.total { padding-top: 20px; padding-bottom: 20px; border-top: 1px solid var(--beige-border); background: var(--field-border); }
.calc-row.boxed { margin-top: 0; padding-top: 30px; padding-bottom: 30px; border: 1px solid var(--field-border); border-radius: 15px; }
.calc-row > .col { flex: 1 1 0; min-width: 0; }
.calc-row .name { display: block; font-size: 18px; font-weight: 700; line-height: 1.5; color: var(--body-text); }
.calc-row .sub { display: block; font-size: 14px; line-height: 1.5; color: var(--body-text); }
.calc-row .amount { display: block; font-size: 18px; font-weight: 700; line-height: 1.5; color: var(--body-text); }
.radio-row { display: flex; flex-wrap: wrap; gap: 15px 40px; }

/* ---- payment block */
.pay-block .form-band { margin-top: 0; }
.pay-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--beige-border); background: linear-gradient(to bottom, rgba(255,255,255,0), var(--beige-400)); }
.pay-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 10px 20px; cursor: pointer; }
.pay-tab + .pay-tab { border-left: 1px solid var(--beige-border); }
.pay-tab img { width: 40px; height: 40px; }
.pay-tab .choice { font-size: 18px; text-transform: uppercase; }
.pay-tab .rb:checked + span { font-weight: 700; }
.pay-tab:hover .choice span { color: var(--orange); }
.pay-fields { padding: 40px 100px 20px; }
.pay-fields .fields { padding-left: 40px; padding-right: 40px; }
.pay-paypal p { padding: 15px 40px; font-size: 16px; line-height: 1.5; text-align: center; }
.terms { padding: 0 40px 40px; font-size: 14px; line-height: 1.5; color: var(--gold); text-align: center; }
.terms a { color: var(--gold); text-underline-position: from-font; }
.terms a:hover { color: var(--orange); }

/* ---- alert banner (e.g. LAST DAY TO SPONSOR) */
.form-alert { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; border: 1px solid var(--gol-orange); border-radius: var(--radius-md); background: var(--gol-orange-50);
    font-size: 20px; font-weight: 700; line-height: 1.5; text-transform: uppercase; color: var(--orange); text-align: center; }
.form-alert svg { flex: none; }
.form-closed { max-width: 760px; margin: 0 auto; padding: 30px 40px; border: 1px solid var(--beige-border); border-radius: var(--radius-md); background: var(--beige-50); font-size: 18px; line-height: 1.6; text-align: center; }
.form-closed p + p { margin-top: 10px; }

/* ---- thank-you pages: photo collage + text */
.collage { display: flex; gap: 10px; max-width: 1400px; margin: auto; padding: 20px; }
.collage .big { flex: 1 1 0; min-width: 0; height: 500px; object-fit: cover; }
.collage .smalls { flex: 0 0 245px; display: flex; flex-direction: column; gap: 10px; }
.collage .smalls img { flex: 1 1 0; min-height: 0; width: 100%; height: 245px; object-fit: cover; }
.ty-text { display: flex; flex-direction: column; gap: 10px; max-width: 1400px; margin: auto; padding: 20px 20px 80px; font-size: 18px; font-weight: 300; line-height: 1.6; color: #000; }
.ty-text.center { text-align: center; }
.ty-text a { color: var(--orange); text-underline-position: from-font; }
.ty-text a:hover { color: var(--orange-300); }

/* ---- tablet */
@media (max-width: 1200px) {
    .form-section { padding-left: 40px; padding-right: 40px; }
    .calc, .pay-fields { padding-left: 20px; padding-right: 20px; }
    .fields.narrow { padding-left: 40px; padding-right: 40px; }
}

/* ---- phones */
@media (max-width: 768px) {
    .title-lines { justify-content: center; padding: 40px 20px 10px; }
    .title-lines::before, .title-lines::after { display: none; }
    .title-lines .titles { padding: 0; }
    .title-lines .eyebrow { font-size: 16px; }
    .title-lines h1 { font-size: 40px; }
    .hero-form .hero-text { text-align: center; }
    .hero-form .kicker { margin-bottom: 8px; font-size: 16px; color: var(--navy); }
    .hero.hero-ty { display: flex; align-items: flex-end; min-height: 550px; padding: 0; color: #fff; background: var(--neutral-darker) url('/res/img/hero-join-thank-you-mobile.webp') center top / cover no-repeat !important; }
    .hero.hero-ty::before { display: block; background: linear-gradient(to top, var(--neutral-darker) 0%, rgba(34,34,34,0) 45%); }
    .hero-ty .hero-text { padding: 40px 20px 20px; text-align: left; }
    .hero-ty .kicker { color: #fff; }
    .hero.hero-ty h1 { color: #fff; text-align: left; font-size: 40px; }
    .title-lines h2 { font-size: 40px; }
    .form-section { padding: 20px 20px 40px; }
    .form-content { padding: 0 20px 20px; }
    .form-content.padded { padding-top: 40px; }
    .form-title { padding: 20px; }
    .form-title h2 { font-size: 40px; }
    .form-headline h3 { font-size: 24px; }
    .form-band { margin-left: -21px; margin-right: -21px; border-radius: 0; }
    .form-band h3 { font-size: 36px; }
    .form-subtitle, .form-text, .toggle-row { padding-left: 0; padding-right: 0; }
    .fields, .fields.narrow { flex-direction: column; gap: 30px; padding: 15px 0; }
    .fld.invisible { display: none; }
    .choice-grid { grid-template-columns: 1fr; row-gap: 30px; padding: 30px 0; }
    .vgroup > .field-error { padding: 0 0 20px; }
    .calc { padding: 0; }
    .calc-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 15px 0; }
    .calc-row.total, .calc-row.boxed { padding-left: 20px; padding-right: 20px; }
    .calc-row.lined { padding-left: 0; padding-right: 0; }
    .fld.money, .fld.money.small { width: 100%; }
    .pay-tabs { margin: 0 -21px; }
    .pay-tab { padding-top: 30px; }
    .pay-tab .choice { font-size: 16px; }
    .pay-fields { padding: 30px 0 10px; }
    .pay-fields .fields { padding-left: 0; padding-right: 0; }
    .pay-paypal p { padding: 10px 0; }
    .terms { padding: 0 0 30px; }
    .btn-wrap .btn-primary { width: 100%; padding: 20px 24px; }
    .form-errors { margin: 20px 0 0; }
    .form-alert { justify-content: space-between; text-align: left; font-size: 18px; }
    .collage { flex-direction: column; padding: 20px; }
    .collage .big { height: auto; aspect-ratio: 350 / 305; }
    .collage .smalls { flex: none; flex-direction: row; }
    .collage .smalls img { width: calc(50% - 5px); height: auto; aspect-ratio: 1; }
    .ty-text { padding: 20px 20px 40px; text-align: left; }
    .ty-text.center { text-align: left; }
}
