/* ==========================================================================
   RS Portal — the application wizard
   Every input is 16px. Anything smaller makes iOS Safari zoom the page on focus
   and never zoom back, which is the single most common reason a form feels
   broken on an iPhone.
   ========================================================================== */

.rs-portal{
  --p-ink:#16193B;
  --p-ink-2:#6A6C86;
  --p-ink-3:#9A9CB2;
  --p-paper:#F7F7FC;
  --p-surface:#FFFFFF;
  --p-line:#E8E9F2;
  --p-line-2:#DCDEEC;
  --p-brand:#3B4EE3;
  --p-brand-dark:#2D3ECB;
  --p-brand-soft:#EBEDFD;
  --p-bad:#D2402A;
  --p-bad-soft:#FCEDEA;
  --p-ok:#1F8A5B;
  --p-r:10px;
  --p-r-lg:14px;

  max-width:820px;
  margin-inline:auto;
  font-family:"Poppins",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  color:var(--p-ink);
}

.rs-portal *,.rs-portal *::before,.rs-portal *::after{ box-sizing:border-box }

.rs-portal__head{ text-align:center; margin-bottom:28px }
.rs-portal__head h2{
  font-family:inherit;
  font-size:clamp(1.6rem,3.6vw,2.2rem); font-weight:700; letter-spacing:-.005em;
  line-height:1.14; margin:0 0 10px; color:var(--p-ink);
}
.rs-portal__sub{ color:var(--p-ink-2); margin:0; font-size:1.05rem; line-height:1.55 }

/* ---------- step rail ---------- */
.rs-steps{
  list-style:none; margin:0 0 22px; padding:0;
  display:grid; grid-template-columns:repeat(4,1fr); gap:6px;
}
.rs-steps__item{
  display:flex; align-items:center; gap:8px;
  padding:10px 6px 12px;
  border-top:3px solid var(--p-line);
  color:var(--p-ink-3); font-size:.8rem; font-weight:600;
  min-width:0;
}
.rs-steps__num{
  width:22px; height:22px; flex:none; border-radius:50%;
  display:grid; place-items:center;
  background:var(--p-line); color:var(--p-ink-2);
  font-size:.7rem; font-weight:700;
}
.rs-steps__label{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.rs-steps__item.is-active{ border-top-color:var(--p-brand); color:var(--p-ink) }
.rs-steps__item.is-active .rs-steps__num{ background:var(--p-brand); color:#fff }
.rs-steps__item.is-done{ border-top-color:var(--p-brand); color:var(--p-ink-2) }
/* The completed marker replaces the digit rather than sitting beside it:
   font-size:0 collapses the number, and the tick sets its own size. */
.rs-steps__item.is-done .rs-steps__num{
  background:var(--p-brand-soft); color:var(--p-brand-dark); font-size:0;
}
.rs-steps__item.is-done .rs-steps__num::after{ content:"\2713"; font-size:.78rem; font-weight:700 }

@media (max-width:560px){
  .rs-steps__label{ display:none }
  .rs-steps__item{ justify-content:center; padding:10px 2px }
}

/* ---------- the card ---------- */
.rs-form{
  background:var(--p-surface);
  border:1px solid var(--p-line);
  border-radius:var(--p-r-lg);
  padding:clamp(20px,4vw,34px);
  box-shadow:0 1px 2px rgba(23,19,52,.05),0 14px 34px rgba(23,19,52,.06);
}

.rs-step[hidden]{ display:none }
.rs-step__title{
  font-family:inherit;
  font-size:1.2rem; font-weight:700; letter-spacing:-.005em; margin:0 0 6px; color:var(--p-ink);
}
.rs-step__hint{ color:var(--p-ink-2); margin:0 0 22px; font-size:.95rem; line-height:1.55 }

/* A dial code beside the number. The select is sized to its content so a long
   country name does not squeeze the number into nothing on a phone. */
.rs-tel{ display:flex; gap:8px; align-items:stretch }
.rs-tel__cc{
  flex:0 0 auto; max-width:44%; min-width:104px;
  font-size:16px; padding:11px 10px;
  border:1.5px solid var(--p-line-2); border-radius:var(--p-r);
  background:var(--p-surface); color:var(--p-ink); font-family:inherit;
}
.rs-tel__num{ flex:1 1 auto; min-width:0 }
@media (max-width:420px){
  .rs-tel{ flex-wrap:wrap }
  .rs-tel__cc{ max-width:none; width:100% }
}

/* The country and dropdown fields, matching the text inputs beside them. */
.rs-fields select{
  width:100%; font-size:16px; font-family:inherit; line-height:1.45;
  padding:12px 14px; color:var(--p-ink);
  border:1.5px solid var(--p-line-2); border-radius:var(--p-r);
  background:var(--p-surface);
}
.rs-fields select:focus{
  outline:none; border-color:var(--p-brand); box-shadow:0 0 0 3px rgba(59,78,227,.16);
}
.rs-fields .rs-optional{ color:var(--p-ink-3); font-weight:500 }

.rs-hp{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden }

/* ---------- step 1: choices ---------- */
.rs-choices{ display:grid; gap:10px }
.rs-choice{ display:block; cursor:pointer }
.rs-choice input{ position:absolute; opacity:0; width:1px; height:1px }
.rs-choice__box{
  display:flex; gap:13px; align-items:flex-start;
  padding:16px 18px;
  border:1.5px solid var(--p-line); border-radius:var(--p-r);
  background:var(--p-surface);
  transition:border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.rs-choice:hover .rs-choice__box{ border-color:var(--p-line-2) }
.rs-choice__tick{
  width:20px; height:20px; flex:none; margin-top:2px;
  border:1.5px solid var(--p-line-2); border-radius:50%;
  position:relative; transition:border-color .16s ease;
}
.rs-choice__tick::after{
  content:""; position:absolute; inset:4px; border-radius:50%;
  background:var(--p-brand); transform:scale(0); transition:transform .16s ease;
}
.rs-choice__text{ display:block; min-width:0 }
.rs-choice__text strong{ display:block; font-size:1rem; font-weight:700; line-height:1.3 }
.rs-choice__text small{ display:block; margin-top:4px; color:var(--p-ink-2); font-size:.86rem; line-height:1.5 }

.rs-choice input:checked + .rs-choice__box{
  border-color:var(--p-brand);
  background:var(--p-brand-soft);
  box-shadow:0 0 0 1px var(--p-brand);
}
.rs-choice input:checked + .rs-choice__box .rs-choice__tick{ border-color:var(--p-brand) }
.rs-choice input:checked + .rs-choice__box .rs-choice__tick::after{ transform:scale(1) }
.rs-choice input:focus-visible + .rs-choice__box{ outline:2px solid var(--p-brand); outline-offset:2px }

/* ---------- step 2: fields ---------- */
.rs-fields{ display:grid; gap:18px }
@media (min-width:620px){ .rs-fields{ grid-template-columns:1fr 1fr } }
.rs-field--wide{ grid-column:1/-1 }

.rs-field label{
  display:block; font-size:.875rem; font-weight:700; margin-bottom:7px; color:var(--p-ink);
}
.rs-req{ color:var(--p-bad); font-weight:700 }
.rs-optional{ color:var(--p-ink-3); font-weight:600; font-size:.78rem }

.rs-portal input[type="text"],
.rs-portal input[type="email"],
.rs-portal input[type="tel"],
.rs-portal input[type="date"],
.rs-portal input[type="number"],
.rs-portal input[type="url"],
.rs-portal textarea{
  width:100%;
  font-family:inherit;
  font-size:16px;          /* do not lower this */
  line-height:1.45;
  color:var(--p-ink);
  padding:13px 15px;
  background:var(--p-surface);
  border:1.5px solid var(--p-line-2);
  border-radius:var(--p-r);
  transition:border-color .16s ease, box-shadow .16s ease;
  -webkit-appearance:none;
  appearance:none;
}
.rs-portal textarea{ resize:vertical; min-height:110px }

/* A date field left alone is sized by the browser to fit "mm/dd/yyyy" and
   nothing more, so it sat at half the width of every other box on its row and
   read as a different kind of control. Given the same width, padding and border
   as the rest, it lines up with them. The little calendar button is kept — it
   is how most people will pick a date — and only toned down. */
.rs-portal input[type="date"]{
  color-scheme:light;                  /* the picker matches the form, not the OS */
}
.rs-portal input[type="date"]::-webkit-datetime-edit{ padding:0 }
.rs-portal input[type="date"]::-webkit-calendar-picker-indicator{
  margin-left:auto;
  padding:4px;
  opacity:.5;
  cursor:pointer;
  transition:opacity .16s ease;
}
.rs-portal input[type="date"]::-webkit-calendar-picker-indicator:hover{ opacity:1 }

.rs-portal input:focus,.rs-portal textarea:focus{
  outline:none; border-color:var(--p-brand); box-shadow:0 0 0 3px rgba(59,78,227,.16);
}
.rs-portal .is-invalid input,
.rs-portal .is-invalid textarea{ border-color:var(--p-bad); background:var(--p-bad-soft) }

.rs-help{ margin:6px 0 0; font-size:.8rem; color:var(--p-ink-3); line-height:1.5 }
.rs-error{
  margin:7px 0 0; font-size:.82rem; font-weight:600; color:var(--p-bad); line-height:1.5;
}
.rs-error--form{
  margin-top:18px; padding:13px 16px;
  background:var(--p-bad-soft); border-radius:var(--p-r); font-weight:600;
}

/* ---------- step 3: documents ---------- */
.rs-drops{ display:grid; gap:16px }
.rs-drop{
  border:1.5px dashed var(--p-line-2); border-radius:var(--p-r);
  padding:18px; background:var(--p-paper);
  transition:border-color .16s ease, background .16s ease;
}
.rs-drop.has-file{ border-style:solid; border-color:var(--p-brand); background:var(--p-brand-soft) }
.rs-drop.is-invalid{ border-style:solid; border-color:var(--p-bad); background:var(--p-bad-soft) }
.rs-drop__label{ display:block; font-size:.95rem; font-weight:700; margin-bottom:4px }
.rs-drop .rs-help{ margin:0 0 12px }

.rs-drop__input{
  display:block; width:100%; font-size:16px; font-family:inherit; color:var(--p-ink-2);
  min-height:48px; padding:11px 0;
}
.rs-drop__input::file-selector-button{
  font-family:inherit; font-size:.875rem; font-weight:700;
  margin-right:12px; padding:10px 18px; min-height:40px;
  border:1px solid var(--p-line-2); border-radius:999px;
  background:var(--p-surface); color:var(--p-ink); cursor:pointer;
}
.rs-drop__input::file-selector-button:hover{ background:#fff; border-color:var(--p-ink-3) }

.rs-drop__state{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin-top:12px; padding:11px 14px;
  background:var(--p-surface); border:1px solid var(--p-line); border-radius:var(--p-r);
}
.rs-drop__name{ font-weight:700; font-size:.9rem; word-break:break-all; min-width:0; flex:1 }
.rs-drop__size{ font-size:.8rem; color:var(--p-ink-3); white-space:nowrap }
.rs-drop__clear{
  font-family:inherit; font-size:.8rem; font-weight:700; color:var(--p-bad);
  background:none; border:0; cursor:pointer; padding:8px 4px; min-height:36px;
}
.rs-drop__clear:hover{ text-decoration:underline }

/* ---------- step 4: review ---------- */
.rs-review{
  border:1px solid var(--p-line); border-radius:var(--p-r);
  overflow:hidden; margin-bottom:22px;
}
.rs-review__group{ border-bottom:1px solid var(--p-line) }
.rs-review__group:last-child{ border-bottom:0 }
.rs-review__head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 16px; background:var(--p-paper);
}
.rs-review__head h4{
  margin:0; font-size:.76rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--p-ink-3);
}
.rs-review__edit{
  font-family:inherit; font-size:.8rem; font-weight:700; color:var(--p-brand);
  background:none; border:0; cursor:pointer; padding:6px 4px; min-height:36px;
}
.rs-review__edit:hover{ text-decoration:underline }
.rs-review__rows{ padding:6px 16px 14px }
.rs-review__row{
  display:grid; grid-template-columns:1fr; gap:2px;
  padding:9px 0; border-bottom:1px solid var(--p-line);
}
.rs-review__row:last-child{ border-bottom:0 }
@media (min-width:560px){
  .rs-review__row{ grid-template-columns:190px 1fr; gap:16px; align-items:baseline }
}
.rs-review__k{ font-size:.82rem; color:var(--p-ink-3); font-weight:600 }
.rs-review__v{ font-size:.95rem; font-weight:600; word-break:break-word }
.rs-review__v--empty{ color:var(--p-ink-3); font-weight:500; font-style:italic }

.rs-consent{
  display:flex; gap:12px; align-items:flex-start;
  padding:16px 18px; background:var(--p-paper);
  border:1px solid var(--p-line); border-radius:var(--p-r);
  cursor:pointer; font-size:.93rem; line-height:1.55;
}
.rs-consent input{ width:20px; height:20px; margin:1px 0 0; flex:none; accent-color:var(--p-brand) }

/* ---------- progress ---------- */
.rs-progress{ margin-top:20px }
.rs-progress__bar{
  height:8px; border-radius:999px; background:var(--p-line); overflow:hidden;
}
.rs-progress__bar span{
  display:block; height:100%; width:0; background:var(--p-brand);
  border-radius:999px; transition:width .2s ease;
}
.rs-progress__label{ margin:9px 0 0; font-size:.85rem; font-weight:600; color:var(--p-ink-2) }

/* ---------- nav ---------- */
.rs-nav-row{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  margin-top:28px; padding-top:22px; border-top:1px solid var(--p-line);
}
.rs-nav-row [data-next],.rs-nav-row [data-submit]{ margin-left:auto }

.rs-portal .rs-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  min-height:48px; padding:13px 26px;
  border-radius:999px; border:1.5px solid transparent;
  font-family:inherit; font-size:.95rem; font-weight:700;
  cursor:pointer; text-decoration:none; white-space:nowrap;
  transition:background .18s ease, border-color .18s ease, transform .14s ease;
}
.rs-portal .rs-btn:active{ transform:translateY(1px) }
.rs-portal .rs-btn--primary{ background:var(--p-brand); color:#fff }
.rs-portal .rs-btn--primary:hover{ background:var(--p-brand-dark) }
.rs-portal .rs-btn--ghost{ background:transparent; color:var(--p-ink); border-color:var(--p-line-2) }
.rs-portal .rs-btn--ghost:hover{ border-color:var(--p-ink-3) }
.rs-portal .rs-btn[disabled]{ opacity:.5; cursor:not-allowed }
.rs-portal .rs-btn[hidden]{ display:none }

@media (max-width:480px){
  .rs-nav-row{ flex-direction:column-reverse; align-items:stretch }
  .rs-nav-row .rs-btn{ width:100% }
  .rs-nav-row [data-next],.rs-nav-row [data-submit]{ margin-left:0 }
}

/* ---------- done ---------- */
.rs-done{
  background:var(--p-surface); border:1px solid var(--p-line); border-radius:var(--p-r-lg);
  padding:clamp(28px,5vw,48px); text-align:center;
  box-shadow:0 1px 2px rgba(23,19,52,.05),0 14px 34px rgba(23,19,52,.06);
}
.rs-done__mark{
  width:56px; height:56px; margin:0 auto 18px; border-radius:50%;
  display:grid; place-items:center;
  background:var(--p-brand-soft); color:var(--p-brand-dark);
  font-size:1.6rem; font-weight:700;
}
.rs-done h3{ font-family:inherit; font-size:1.5rem; font-weight:700; letter-spacing:-.005em; margin:0 0 10px }
.rs-done p{ color:var(--p-ink-2); margin:0 0 10px; line-height:1.6 }
.rs-done__ref{ font-size:1.05rem }
.rs-done__ref strong{
  display:inline-block; margin-left:8px; padding:5px 14px;
  background:var(--p-paper); border:1px solid var(--p-line); border-radius:999px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; color:var(--p-ink); letter-spacing:.02em;
}
.rs-done__small{ font-size:.88rem; color:var(--p-ink-3)!important; margin-top:16px!important }

@media (prefers-reduced-motion:reduce){
  .rs-portal *{ transition-duration:.001ms!important }
}


/* ==========================================================================
   PHONES — the wizard
   This is the screen that matters most: most applicants arrive on a phone, and
   an application abandoned half way is an application the society never sees.
   ========================================================================== */
@media (max-width:640px){
  .rs-portal__head{ margin-bottom:22px }
  .rs-form{ padding:20px 18px; border-radius:20px }

  .rs-step__title{ font-size:1.3rem }
  .rs-step__hint{ font-size:.9rem; margin-bottom:18px }

  /* Bigger hit area per choice — this is a list people tap, repeatedly, with
     a thumb, often one-handed on a bus. */
  .rs-choice__box{ padding:15px 16px; gap:12px }
  .rs-choice__text strong{ font-size:.96rem }
  .rs-choice__text small{ font-size:.82rem }

  .rs-drop{ padding:16px }
  .rs-drop__state{ padding:10px 12px }
  .rs-drop__clear{ min-height:44px; padding:10px 6px }

  .rs-review__head{ padding:11px 14px }
  .rs-review__rows{ padding:4px 14px 12px }
  .rs-review__edit{ min-height:44px; padding:10px 4px }

  .rs-consent{ padding:15px 16px; font-size:.9rem }

  /* The done panel is the last thing an applicant sees; the reference has to be
     readable and selectable, not squeezed. */
  .rs-done__ref{ font-size:1rem }
  .rs-done__ref strong{ display:block; margin:8px 0 0; word-break:break-all }
}

/* What happens next, on the confirmation screen. The letter is not issued here:
   it follows the society's decision, and saying so plainly is the difference
   between an applicant who waits and one who emails asking where it is. */
.rs-done__next{
  margin:22px auto 0; max-width:34rem; padding:20px 24px;
  background:var(--rs-brand-soft, #EBEDFD); border-radius:14px;
  text-align:left;
}
.rs-done__next-title{
  margin:0 0 6px; font-weight:600; color:var(--rs-ink, #16193B);
}
.rs-done__next p{ margin:0; color:var(--rs-ink-2, #6A6C86); font-size:.95rem; line-height:1.6 }

/* ==========================================================================
   WHATSAPP HELP BAND
   ==========================================================================
   Under the wizard, on every step. Green because that is what WhatsApp is —
   the colour is the label, which is why the panel does not carry the site's
   indigo.

   Three columns on a desktop (mark, words, button) collapsing to one on a
   phone, where a button beside a paragraph would leave both too narrow to
   read. */
.rs-wahelp{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:clamp(16px,2.4vw,30px);
  padding:clamp(20px,3vw,30px) clamp(20px,3vw,34px);
  border-radius:20px;
  color:#fff;
  background:linear-gradient(104deg,#25D366 0%,#1FBE5C 48%,#129D6E 100%);
  box-shadow:0 10px 30px rgba(18,157,110,.22);
  font-family:var(--rs-sans,system-ui,sans-serif);
}

/* The gap goes underneath when it leads the page and above when it follows, so
   it never collapses against whichever of the two it sits next to. */
.rs-wahelp--top{ margin-bottom:clamp(24px,3.4vw,40px) }
.rs-wahelp--bottom{ margin-top:clamp(28px,4vw,44px) }

.rs-wahelp__ic{
  display:grid; place-items:center;
  width:56px; height:56px; border-radius:50%;
  color:#fff; background:rgba(255,255,255,.16);
}

.rs-wahelp__title{
  margin:0 0 6px; font-size:clamp(1.12rem,2vw,1.42rem); font-weight:700;
  color:#fff; letter-spacing:-.01em; line-height:1.25;
}
.rs-wahelp__text{
  margin:0; font-size:.95rem; line-height:1.6;
  /* Not pure white: the heading has to stay the first thing read. */
  color:rgba(255,255,255,.92);
}

.rs-wahelp__btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  min-height:52px; padding:13px 26px;
  border:2px solid rgba(255,255,255,.9); border-radius:999px;
  color:#fff; background:rgba(255,255,255,.12);
  font-size:1rem; font-weight:700; text-decoration:none; text-align:center;
  transition:background .18s ease, transform .18s ease;
}
.rs-wahelp__btn:hover,
.rs-wahelp__btn:focus-visible{ background:rgba(255,255,255,.22); color:#fff }
@media (hover:hover){ .rs-wahelp__btn:hover{ transform:translateY(-1px) } }
.rs-wahelp__btn svg{ flex:none }

@media (max-width:820px){
  .rs-wahelp{
    grid-template-columns:auto minmax(0,1fr);
    row-gap:18px;
  }
  /* The button drops to its own row and runs the full width, which on a phone
     is the difference between a target and a guess. */
  .rs-wahelp__btn{ grid-column:1 / -1; width:100% }
}

@media (max-width:520px){
  .rs-wahelp{ grid-template-columns:1fr; text-align:center; justify-items:center }
  .rs-wahelp__ic{ width:48px; height:48px }
}

@media (prefers-reduced-motion:reduce){
  .rs-wahelp__btn{ transition:none }
  .rs-wahelp__btn:hover{ transform:none }
}
