* {
  box-sizing: border-box;
}
:root {
  --navy: #0b356f;
  --navy2: #062a5e;
  --green: #299528;
  --light-green: #eaf6e8;
  --border: #aeb9c8;
  --text: #18202b;
}
body {
  margin: 0;
  background: #e9edf2;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
}
.page {
  width: min(1120px, calc(100% - 24px));
  margin: 18px auto;
  background: #fff;
  border: 5px solid var(--navy);
  border-radius: 15px 15px 0 0;
  box-shadow: 0 8px 25px #0002;
  overflow: hidden;
}
.hero {
  display: grid;
  grid-template-columns: 28% 48% 24%;
  align-items: center;
  padding: 16px 18px 10px;
  gap: 8px;
}
.brand {
  text-align: left;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.mass-logo-img {
  max-width: 100%;
  height: auto;
  max-height: 75px;
  object-fit: contain;
  display: block;
  margin: 0;
}
.hero-title {
  text-align: center;
}
.hero-title h1 {
  margin: 0;
  color: var(--navy);
  font-size: 38px;
  line-height: 1.05;
}
.hero-title h2 {
  margin: 3px 0 9px;
  color: var(--green);
  font-size: 34px;
  line-height: 1.05;
}
.join-badge {
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 8px;
}
.join-badge strong {
  font-size: 17px;
}
.join-badge span {
  font-size: 12px;
  margin-top: 2px;
}
.trust-box {
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.trust-icon {
  font-size: 35px;
}
.trust-box strong {
  font-size: 13px;
  line-height: 1.35;
}
.trust-box span {
  display: block;
  color: #68c63d;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}
.benefits {
  margin: 0 14px 13px;
  border: 2px solid #778ca9;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 13px 6px;
}
.benefits article {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  border-right: 1px dotted #9aa7b7;
  padding: 0 7px;
}
.benefits article:last-child {
  border-right: 0;
}
.benefit-icon {
  width: 47px;
  height: 47px;
  min-width: 47px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
}
.benefits b {
  font-size: 12px;
  color: var(--navy);
  line-height: 1.15;
}
.benefits span {
  display: block;
  font-size: 11px;
  line-height: 1.25;
  margin-top: 4px;
}
.columns {
  display: grid;
  grid-template-columns: 64% 36%;
  gap: 12px;
  padding: 0 14px 14px;
}
.left-column,
.right-column {
  min-width: 0;
}
.form-section,
.declaration {
  border: 1px solid #b9c1cb;
  border-radius: 10px;
  margin-bottom: 9px;
  padding: 22px 13px 12px;
  position: relative;
}
.form-section h3 {
  position: absolute;
  top: -12px;
  left: -1px;
  margin: 0;
  background: var(--navy);
  color: #fff;
  padding: 5px 13px;
  border-radius: 3px;
  font-size: 13px;
  letter-spacing: 0.1px;
}
.field {
  margin-bottom: 8px;
}
.field > label:not(.row-label):not(.choice-radio) {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 3px;
}
.field em,
.doc-row em,
.declaration em {
  color: #a00000;
  font-style: normal;
  margin-left: 2px;
}
.field input,
.field select {
  width: 100%;
  height: 29px;
  border: 1px solid #aeb8c5;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  background: #fff;
}
.field input:focus,
.field select:focus {
  outline: 2px solid #b7dbb5;
  border-color: var(--green);
}
.field.full input + input {
  margin-top: 5px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr;
  gap: 16px;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 17px;
  align-items: center;
}
.checks label,
.radio-row label {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.checks input,
.radio-row input {
  margin-right: 4px;
}
.inline-other {
  width: 95px !important;
  height: 25px !important;
}
.phone-input {
  display: flex;
}
.phone-input span {
  height: 29px;
  border: 1px solid #aeb8c5;
  background: #f3f5f7;
  padding: 7px 8px;
  font-size: 12px;
  border-radius: 4px 0 0 4px;
}
.phone-input input {
  border-radius: 0 4px 4px 0 !important;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 29px;
}
.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.radio-row input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 0;
  border: 1.5px solid #8d959e;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.radio-row input[type="radio"]:checked {
  border-color: var(--green);
}
.radio-row input[type="radio"]:checked::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.docs {
  min-height: 450px;
}
.notice {
  background: #e7f4e3;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  margin: 3px 0 10px;
}
.doc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 3px;
  padding: 8px 2px;
  border-bottom: 1px solid #eef1f4;
  min-height: 40px;
}
.doc-row:last-of-type {
  border-bottom: 0;
}
.doc-row .doc-check {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin: 0;
  border: 1.5px solid #8d959e;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  position: relative;
  display: block;
}
.doc-row .doc-check:checked {
  background: var(--green);
  border-color: var(--green);
}
.doc-row .doc-check:checked::after {
  content: "✓";
  position: absolute;
  left: 3px;
  top: -1px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.doc-row label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  margin: 0;
  flex: 1 1 60%;
}
.doc-row small {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}
.doc-file {
  display: none !important;
}
.attach-btn {
  border: 1px solid #aeb8c5;
  background: #fff;
  color: var(--navy);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.attach-btn:hover {
  background: #f1f5fa;
}
.attached-name {
  width: 100%;
  font-size: 9.5px;
  color: #2d7b2b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.file-help {
  font-size: 10px;
  color: #66717f;
  margin: 12px 4px 5px;
}
.file-summary {
  background: #f6f8fa;
  border: 1px dashed #adb7c4;
  padding: 7px;
  border-radius: 5px;
  font-size: 10px;
  color: #4e5965;
}
.portal {
  padding-top: 24px;
}
.portal h3 small {
  font-size: 9px;
  font-weight: 400;
}
.portal .field {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 10px;
}
.portal .field label {
  margin: 0;
}
.declaration {
  background: #eff9ec;
  border-color: #c8dfc1;
  padding-top: 28px;
}
.declaration h3 {
  position: static;
  background: none;
  color: #277d26;
  padding: 0;
  font-size: 13px;
}
.declaration p {
  font-size: 11px;
  line-height: 1.4;
  margin: 8px 0;
}
.submit-box {
  border-radius: 10px;
  background: #edf8e9;
  border: 1px solid #cbdcc6;
  overflow: hidden;
  margin-bottom: 12px;
}
.submit-box h3 {
  background: var(--green);
  color: #fff;
  margin: 0;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.submit-box-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #edf8e9;
}
.contact-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #18202b;
}
.contact-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  fill: var(--green);
  flex-shrink: 0;
}
.contact-line b {
  color: var(--navy);
  font-weight: 700;
}
.submit-btn {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  padding: 13px;
  cursor: pointer;
}
.submit-btn:hover {
  filter: brightness(0.94);
}
.submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.status {
  display: none;
  margin-top: 9px;
  padding: 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}
.status.show {
  display: block;
}
.status.success {
  background: #e6f5e2;
  color: #216e20;
}
.status.error {
  background: #fdeaea;
  color: #a02121;
}
footer {
  background: var(--navy2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  font-size: 11px;
}
.footer-col {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
}
.footer-col:last-of-type {
  border-right: none;
}
.footer-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  color: #ffffff;
  flex-shrink: 0;
}
.footer-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.footer-text strong {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  white-space: nowrap;
}
.footer-text small {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
  white-space: nowrap;
}
.footer-text a {
  color: #ffffff;
  text-decoration: none;
}
.footer-text a:hover {
  text-decoration: underline;
}
.footer-logo-col {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-left: 8px;
}
.footer-logo-img {
  max-height: 36px;
  max-width: 140px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  display: block;
  /* Original logo image colors preserved with zero filters */
}
@media (max-width: 850px) {
  .page {
    width: 100%;
    margin: 0;
    border-width: 3px;
    border-radius: 0;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 10px 12px 6px;
    gap: 8px;
    text-align: center;
  }
  .brand {
    justify-content: center;
    text-align: center;
  }
  .mass-logo-img {
    max-height: 48px;
    max-width: 180px;
    margin: 0 auto;
  }
  .hero-title h1 {
    font-size: 22px;
    line-height: 1.1;
  }
  .hero-title h2 {
    font-size: 18px;
    line-height: 1.1;
    margin: 2px 0 6px;
  }
  .trust-box {
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
  }
  .trust-icon {
    font-size: 26px;
  }
  .trust-box strong {
    font-size: 12px;
    line-height: 1.25;
  }
  .trust-box span {
    font-size: 11px;
  }
  .benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    margin: 0 8px 10px;
    border-width: 1px;
  }
  .benefits article {
    border-right: 0;
    border-bottom: 0;
    background: #f4f7fb;
    border-radius: 8px;
    padding: 8px 10px;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    box-sizing: border-box;
  }
  .benefits article:nth-child(5) {
    grid-column: span 2;
  }
  .benefit-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 16px;
    flex-shrink: 0;
  }
  .benefits b {
    font-size: 11px;
    line-height: 1.2;
    display: block;
  }
  .benefits span {
    font-size: 9.5px;
    line-height: 1.25;
    margin-top: 2px;
    display: block;
  }
  .columns {
    display: flex;
    flex-direction: column;
  }
  .left-column,
  .right-column {
    display: contents;
  }
  .left-column > section:nth-of-type(1) {
    order: 1;
  }
  .left-column > section:nth-of-type(2) {
    order: 2;
  }
  .left-column > section:nth-of-type(3) {
    order: 3;
  }
  .left-column > section:nth-of-type(4) {
    order: 4;
  }
  .right-column > section.docs {
    order: 5;
  }
  .right-column > section.portal {
    order: 6;
  }
  .right-column > section.submit-box {
    order: 7;
  }
  .left-column > section.declaration {
    order: 8;
  }
  .right-column > button.submit-btn {
    order: 9;
  }
  .right-column > div.status {
    order: 10;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .portal .field {
    grid-template-columns: 100px 1fr;
  }
  footer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px;
    padding: 14px 18px;
  }
  .footer-col {
    padding-right: 0;
    border-right: none;
  }
  .footer-text strong,
  .footer-text small {
    white-space: normal;
    word-break: break-word;
  }
  .footer-logo-col {
    justify-content: flex-start;
    padding-left: 0;
  }
  .mass-logo {
    font-size: 52px;
  }
}
@media (max-width: 520px) {
  .hero {
    padding: 8px;
  }
  .mass-logo-img {
    max-height: 42px;
    max-width: 160px;
  }
  .hero-title h1 {
    font-size: 20px;
  }
  .hero-title h2 {
    font-size: 17px;
  }
  .checks {
    gap: 8px;
  }
  .columns {
    padding: 0 8px 10px;
  }
  .form-section {
    padding-left: 10px;
    padding-right: 10px;
  }
  .portal .field {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    gap: 0;
  }
  .doc-row {
    font-size: 11px;
  }
  footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }
  .footer-logo-col {
    justify-content: center;
  }
  .footer-logo-img {
    margin: 0 auto;
  }
}

.account-type-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ============================================================
   REFERENCE UI ALIGNMENT & ANTI-JUMPING FIXES
   Center Type + Account Type
   ============================================================ */

/* Inline Row Layouts for Center Type & Account Type */
.center-type-field,
.account-type-field {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 25px;
  margin-bottom: 9px;
}

.center-type-field .row-label,
.account-type-field .row-label {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  height: 25px;
  color: var(--text);
  white-space: nowrap;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
}

.center-type-field .row-label em,
.account-type-field .row-label em {
  color: #a00000;
  font-style: normal;
  margin-left: 2px;
}

.center-type-options,
.account-type-options {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
  height: 25px;
  margin: 0;
  padding: 0;
}

/* Single-select Choice Container */
.choice-radio,
.field label.choice-radio {
  position: relative;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 25px !important;
  gap: 6px;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.choice-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  margin: 0;
}

/* Square Box for Center Type (Matches Reference Image UI) */
.choice-box {
  position: relative;
  width: 15px;
  height: 15px;
  min-width: 15px;
  box-sizing: border-box;
  border: 1.4px solid #8d959e;
  border-radius: 3px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
}

.choice-box::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  color: #fff;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.1s ease;
  pointer-events: none;
}

.choice-radio input[type="radio"]:checked + .choice-box {
  background: var(--green);
  border-color: var(--green);
}

.choice-radio input[type="radio"]:checked + .choice-box::after {
  opacity: 1;
}

/* Circle Dot for Account Type */
.radio-dot {
  position: relative;
  width: 15px;
  height: 15px;
  min-width: 15px;
  box-sizing: border-box;
  border: 1.4px solid #8d959e;
  border-radius: 50%;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
}

.radio-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0;
  transition: opacity 0.1s ease;
  pointer-events: none;
}

.choice-radio input[type="radio"]:checked + .radio-dot {
  border-color: var(--green);
}

.choice-radio input[type="radio"]:checked + .radio-dot::after {
  opacity: 1;
}

/* Choice text formatting (prevents vertical jump) */
.choice-text {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  margin: 0;
}

.other-choice {
  gap: 6px;
}

.other-center-input {
  width: 90px !important;
  height: 25px !important;
  margin: 0 0 0 2px !important;
  padding: 3px 6px !important;
  font-size: 10.5px !important;
  border: 1px solid #b8c1cc !important;
  border-radius: 4px !important;
  background: #fff;
  vertical-align: middle;
}

.other-center-input:disabled {
  background: #f3f5f7 !important;
  border-color: #d1d8e0 !important;
  cursor: not-allowed;
}

.other-center-input:focus {
  outline: none !important;
  border-color: var(--navy) !important;
  box-shadow: 0 0 0 2px rgba(11, 53, 111, 0.15) !important;
}

/* Prevent generic input styling stretching radio inputs */
.center-type-options input,
.account-type-options input {
  box-sizing: border-box;
}

@media (max-width: 850px) {
  .center-type-field,
  .account-type-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    height: auto !important;
    min-height: auto !important;
  }
  .center-type-field .row-label,
  .account-type-field .row-label {
    width: 100%;
    margin-bottom: 4px !important;
  }
  .center-type-options,
  .account-type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 12px;
    width: 100%;
    height: auto !important;
  }
  .center-type-options .choice-radio,
  .account-type-options .choice-radio {
    justify-content: flex-start !important;
  }
  .other-center-input {
    width: 75px !important;
  }
}

/* Reference-layout correction: keep original two-column form structure. */
@media (min-width: 851px) {
  .page {
    width: 1100px;
    max-width: calc(100vw - 24px);
  }

  .columns {
    grid-template-columns: 64% 36%;
    gap: 12px;
  }
}
