.online-application {
  --apply-blue: #2f73b8;
  --apply-blue-dark: #23588e;
  --apply-ink: #263442;
  --apply-muted: #617184;
  --apply-line: #dbe4ec;
  --apply-error: #c62828;
  max-width: 1040px;
  margin: 64px auto 96px;
  padding: 0 24px;
  color: var(--apply-ink);
  font-family: Montserrat, Arial, sans-serif;
}

.online-application * {
  box-sizing: border-box;
}

.apply-intro {
  margin-bottom: 30px;
  text-align: center;
}

.apply-eyebrow {
  margin: 0 0 8px;
  color: var(--apply-blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.apply-title {
  margin: 0;
  color: var(--apply-blue-dark);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
}

.apply-description {
  max-width: 760px;
  margin: 14px auto 0;
  color: var(--apply-muted);
  font-size: 15px;
  line-height: 1.75;
}

.apply-required-note {
  margin: 12px 0 0;
  color: var(--apply-muted);
  font-size: 13px;
}

.required-star {
  color: var(--apply-error);
  font-weight: 800;
}

.application-form {
  display: grid;
  gap: 24px;
}

.apply-section {
  padding: 28px;
  border: 1px solid var(--apply-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(35, 88, 142, 0.06);
}

.apply-section h3 {
  margin: 0 0 22px;
  color: var(--apply-blue-dark);
  font-size: 22px;
  line-height: 1.35;
}

.apply-section-note {
  margin: -12px 0 20px;
  color: var(--apply-muted);
  font-size: 13px;
  line-height: 1.6;
}

.apply-recommendation-sample {
  display: flex;
  grid-column: 1 / -1;
  margin-bottom: 4px;
  padding: 16px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(47, 115, 184, 0.3);
  border-radius: 9px;
  background: #f3f8fd;
}

.apply-recommendation-sample div {
  display: grid;
  gap: 4px;
}

.apply-recommendation-sample strong {
  color: var(--apply-blue-dark);
  font-size: 15px;
  line-height: 1.4;
}

.apply-recommendation-sample span {
  color: var(--apply-muted);
  font-size: 12px;
  line-height: 1.55;
}

.apply-recommendation-sample a {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--apply-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}

.apply-recommendation-sample a:hover,
.apply-recommendation-sample a:focus-visible {
  background: var(--apply-blue-dark);
  outline: 3px solid rgba(47, 115, 184, 0.18);
  outline-offset: 2px;
}

.apply-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.apply-field {
  min-width: 0;
}

.apply-field.full {
  grid-column: 1 / -1;
}

.apply-field label,
.apply-field legend {
  display: block;
  margin: 0 0 7px;
  color: var(--apply-ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.apply-field input,
.apply-field select,
.apply-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #b9c7d3;
  border-radius: 6px;
  background: #fff;
  color: #152536;
  font: inherit;
  font-size: 15px;
}

.apply-field textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.6;
}

.apply-field input:focus,
.apply-field select:focus,
.apply-field textarea:focus {
  border-color: var(--apply-blue);
  outline: 3px solid rgba(47, 115, 184, 0.16);
}

.apply-help {
  display: block;
  margin-top: 6px;
  color: var(--apply-muted);
  font-size: 12px;
  line-height: 1.55;
}

.apply-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding-top: 5px;
}

.apply-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
}

.apply-choice input {
  width: 17px;
  min-height: 17px;
  margin: 0;
}

.apply-file {
  padding: 15px !important;
  border-style: dashed !important;
  background: #f7fbff !important;
}

.apply-file-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.apply-file-empty {
  color: var(--apply-muted);
  font-size: 12px;
}

.apply-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--apply-line);
  border-radius: 6px;
  background: #f7fbff;
}

.apply-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--apply-ink);
  font-size: 13px;
  line-height: 1.45;
}

.apply-file-remove {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #dfaaaa;
  border-radius: 5px;
  background: #fff;
  color: #9a2020;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.apply-file-remove:hover,
.apply-file-remove:focus-visible {
  border-color: var(--apply-error);
  background: #fff1f1;
  outline: none;
}

.apply-error-summary {
  display: none;
  padding: 15px 18px;
  border: 1px solid #ef9a9a;
  border-radius: 8px;
  background: #fff1f1;
  color: #8e1717;
  font-size: 14px;
  line-height: 1.6;
}

.apply-error-summary.visible {
  display: block;
}

.apply-validation-mode .apply-field-invalid {
  padding: 14px;
  border: 2px solid var(--apply-error);
  border-radius: 8px;
  background: #fff8f8;
  scroll-margin-top: 28px;
}

.apply-validation-mode .apply-field-invalid > input,
.apply-validation-mode .apply-field-invalid > select,
.apply-validation-mode .apply-field-invalid > textarea {
  border-color: var(--apply-error);
}

.apply-inline-error {
  display: block;
  margin-top: 8px;
  color: var(--apply-error);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.apply-error-list {
  margin: 10px 0 0;
  padding-left: 20px;
}

.apply-error-list li + li {
  margin-top: 5px;
}

.apply-error-jump {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.apply-error-jump:hover,
.apply-error-jump:focus-visible {
  color: #611010;
  outline: 2px solid rgba(198, 40, 40, 0.28);
  outline-offset: 3px;
}

.apply-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.apply-submit {
  min-width: 210px;
  padding: 14px 26px;
  border: 0;
  border-radius: 6px;
  background: var(--apply-blue);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.apply-submit:hover {
  background: var(--apply-blue-dark);
}

.apply-submit:disabled {
  cursor: wait;
  opacity: 0.66;
}

.apply-status {
  color: var(--apply-muted);
  font-size: 14px;
}

.apply-success {
  padding: 26px;
  border: 1px solid #8bc6a0;
  border-radius: 10px;
  background: #f0fbf4;
  color: #16572d;
  line-height: 1.7;
}

.apply-pdf-download {
  display: inline-flex;
  margin-top: 16px;
  padding: 11px 16px;
  border-radius: 6px;
  background: #23588e;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.apply-pdf-download:hover,
.apply-pdf-download:focus-visible {
  background: #173e68;
  color: #fff;
}

.apply-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

@media (max-width: 720px) {
  .online-application {
    margin-top: 44px;
    padding: 0 16px;
  }

  .apply-section {
    padding: 22px 18px;
  }

  .apply-grid {
    grid-template-columns: 1fr;
  }

  .apply-field.full {
    grid-column: auto;
  }

  .apply-submit {
    width: 100%;
  }

  .apply-file-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .apply-recommendation-sample {
    align-items: stretch;
    flex-direction: column;
  }

  .apply-recommendation-sample a {
    width: 100%;
  }
}

/* Recommendation form download card shown beneath the existing master forms. */
.hx-recommendation-download-wrap {
  clear: both;
  padding: 30px 10px 8px;
}

.hx-recommendation-download {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 600px;
  min-height: 150px;
  margin: 0 auto;
  padding: 22px 118px 22px 178px;
  align-items: center;
  overflow: visible;
  border: 1px solid rgba(47, 16, 66, 0.7);
  border-radius: 18px;
  background: #4e2869;
  box-shadow: 0 12px 0 #2b0744, 0 24px 28px rgba(38, 16, 50, 0.25);
  color: #fff;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hx-recommendation-download:hover,
.hx-recommendation-download:focus-visible {
  color: #fff;
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 15px 0 #2b0744, 0 27px 31px rgba(38, 16, 50, 0.28);
}

.hx-recommendation-download:focus-visible {
  outline: 3px solid #f2c94c;
  outline-offset: 5px;
}

.hx-recommendation-download-icon {
  position: absolute;
  z-index: 3;
  top: -1px;
  bottom: -1px;
  left: -1px;
  width: 154px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 9px 0 #3c0e58;
}

.hx-recommendation-download-icon::after {
  position: absolute;
  top: 50%;
  right: -28px;
  width: 60px;
  height: 60px;
  background: #fff;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.hx-recommendation-download-arrow,
.hx-recommendation-download-arrow::before,
.hx-recommendation-download-arrow::after {
  position: absolute;
  z-index: 4;
  display: block;
  content: "";
}

.hx-recommendation-download-arrow {
  top: 38px;
  left: 70px;
  width: 14px;
  height: 52px;
  border-radius: 5px;
  background: #542176;
}

.hx-recommendation-download-arrow::before {
  top: 29px;
  left: -17px;
  width: 36px;
  height: 36px;
  border-right: 7px solid #542176;
  border-bottom: 7px solid #542176;
  border-radius: 4px;
  transform: rotate(45deg);
}

.hx-recommendation-download-arrow::after {
  display: none;
}

.hx-recommendation-download-botanical {
  position: absolute;
  z-index: 1;
  top: -7px;
  left: 184px;
  width: 265px;
  height: 114px;
  opacity: 0.28;
  background:
    radial-gradient(ellipse 32px 13px at 30px 62px, #bf86df 0 92%, transparent 100%),
    radial-gradient(ellipse 34px 14px at 72px 45px, #bf86df 0 92%, transparent 100%),
    radial-gradient(ellipse 35px 14px at 116px 31px, #bf86df 0 92%, transparent 100%),
    radial-gradient(ellipse 34px 14px at 161px 23px, #bf86df 0 92%, transparent 100%),
    radial-gradient(ellipse 32px 13px at 204px 17px, #bf86df 0 92%, transparent 100%);
  transform: rotate(-8deg);
}

.hx-recommendation-download-botanical::before {
  position: absolute;
  top: 29px;
  left: 6px;
  width: 230px;
  height: 70px;
  border-top: 5px solid #bf86df;
  border-radius: 50%;
  content: "";
  transform: rotate(-8deg);
}

.hx-recommendation-download-copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.18;
}

.hx-recommendation-download-school {
  margin-bottom: 8px;
  font-size: clamp(18px, 2vw, 27px);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.hx-recommendation-download-title {
  font-size: clamp(25px, 3vw, 42px);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.hx-recommendation-download-ext {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 24px;
  font-family: Arial, sans-serif;
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 800;
  line-height: 1;
  transform: translateY(-50%);
}

.hx-recommendation-download.is-english {
  padding-left: 210px;
  padding-right: 115px;
}

.hx-recommendation-download.is-english .hx-recommendation-download-copy {
  text-align: center;
}

.hx-recommendation-download.is-english .hx-recommendation-download-school {
  font-size: clamp(14px, 1.65vw, 20px);
  font-weight: 600;
  letter-spacing: 0;
}

.hx-recommendation-download.is-english .hx-recommendation-download-title {
  font-size: clamp(20px, 2.35vw, 28px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.08;
}

@media (max-width: 720px) {
  .hx-recommendation-download-wrap {
    padding: 26px 0 8px;
  }
}

@media (max-width: 479px) {
  .hx-recommendation-download,
  .hx-recommendation-download.is-english {
    min-height: 112px;
    padding: 16px 72px 16px 126px;
    border-radius: 14px;
    box-shadow: 0 8px 0 #2b0744, 0 17px 22px rgba(38, 16, 50, 0.22);
  }

  .hx-recommendation-download-icon {
    width: 114px;
    box-shadow: 0 6px 0 #3c0e58;
  }

  .hx-recommendation-download-icon::after {
    right: -21px;
    width: 46px;
    height: 46px;
  }

  .hx-recommendation-download-arrow {
    top: 28px;
    left: 51px;
    width: 12px;
    height: 39px;
  }

  .hx-recommendation-download-arrow::before {
    top: 21px;
    left: -14px;
    width: 30px;
    height: 30px;
    border-right-width: 6px;
    border-bottom-width: 6px;
  }

  .hx-recommendation-download-botanical {
    left: 125px;
    transform: scale(0.78) rotate(-8deg);
    transform-origin: left top;
  }

  .hx-recommendation-download-school {
    margin-bottom: 5px;
    font-size: clamp(12px, 4vw, 18px);
  }

  .hx-recommendation-download-title {
    font-size: clamp(19px, 6vw, 29px);
  }

  .hx-recommendation-download-ext {
    right: 13px;
    font-size: clamp(31px, 10vw, 48px);
  }

  .hx-recommendation-download.is-english .hx-recommendation-download-school {
    font-size: clamp(10px, 3.3vw, 15px);
  }

  .hx-recommendation-download.is-english .hx-recommendation-download-title {
    font-size: clamp(14px, 4.1vw, 20px);
  }
}

@media (max-width: 410px) {
  .hx-recommendation-download,
  .hx-recommendation-download.is-english {
    padding-left: 105px;
    padding-right: 58px;
  }

  .hx-recommendation-download-icon {
    width: 94px;
  }

  .hx-recommendation-download-icon::after {
    right: -19px;
    width: 44px;
    height: 44px;
  }

  .hx-recommendation-download-arrow {
    left: 40px;
  }
}

.hx-recommendation-download.is-doctoral {
  border-color: rgba(18, 52, 54, 0.82);
  background: #294b4c;
  box-shadow: 0 12px 0 #123133, 0 24px 28px rgba(18, 49, 51, 0.25);
}

.hx-recommendation-download.is-doctoral:hover,
.hx-recommendation-download.is-doctoral:focus-visible {
  box-shadow: 0 15px 0 #123133, 0 27px 31px rgba(18, 49, 51, 0.29);
}

.hx-recommendation-download.is-doctoral .hx-recommendation-download-icon {
  box-shadow: 0 9px 0 #17383a;
}

.hx-recommendation-download.is-doctoral .hx-recommendation-download-arrow {
  background: #2b5658;
}

.hx-recommendation-download.is-doctoral .hx-recommendation-download-arrow::before {
  border-right-color: #2b5658;
  border-bottom-color: #2b5658;
}

.hx-recommendation-download.is-doctoral .hx-recommendation-download-botanical {
  background:
    radial-gradient(ellipse 32px 13px at 30px 62px, #6b9697 0 92%, transparent 100%),
    radial-gradient(ellipse 34px 14px at 72px 45px, #6b9697 0 92%, transparent 100%),
    radial-gradient(ellipse 35px 14px at 116px 31px, #6b9697 0 92%, transparent 100%),
    radial-gradient(ellipse 34px 14px at 161px 23px, #6b9697 0 92%, transparent 100%),
    radial-gradient(ellipse 32px 13px at 204px 17px, #6b9697 0 92%, transparent 100%);
}

.hx-recommendation-download.is-doctoral .hx-recommendation-download-botanical::before {
  border-top-color: #6b9697;
}

@media (max-width: 479px) {
  .hx-recommendation-download.is-doctoral {
    box-shadow: 0 8px 0 #123133, 0 17px 22px rgba(18, 49, 51, 0.22);
  }

  .hx-recommendation-download.is-doctoral .hx-recommendation-download-icon {
    box-shadow: 0 6px 0 #17383a;
  }
}

/* Dedicated master's single-course page: current form download and notice. */
.hx-single-course-materials {
  clear: both;
  margin: 34px 0 38px;
}

.hx-single-course-download-wrap {
  padding: 4px 10px 0;
}

.hx-single-course-download {
  display: grid;
  width: 100%;
  max-width: 700px;
  min-height: 112px;
  margin: 0 auto;
  padding: 20px 24px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  border: 1px solid #176382;
  border-radius: 14px;
  background: linear-gradient(135deg, #174f69 0%, #277d9c 100%);
  box-shadow: 0 12px 24px rgba(22, 79, 105, 0.2);
  color: #fff;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hx-single-course-download:hover,
.hx-single-course-download:focus-visible {
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 15px 28px rgba(22, 79, 105, 0.26);
}

.hx-single-course-download:focus-visible {
  outline: 3px solid #e5b85b;
  outline-offset: 4px;
}

.hx-single-course-pdf-badge {
  display: flex;
  width: 62px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff;
  color: #174f69;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hx-single-course-download-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.hx-single-course-download-label {
  color: #d9f0f8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hx-single-course-download-title {
  font-size: clamp(19px, 2.6vw, 28px);
  font-weight: 700;
  line-height: 1.3;
}

.hx-single-course-download-action {
  display: inline-flex;
  padding: 10px 14px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.hx-single-course-notice {
  max-width: 700px;
  margin: 30px auto 0;
  padding: 26px 28px;
  border: 1px solid #c9dbe3;
  border-left: 5px solid #277d9c;
  border-radius: 0 12px 12px 0;
  background: #f5fafc;
  box-shadow: 0 8px 18px rgba(35, 82, 104, 0.08);
  color: #253f4a;
}

.hx-single-course-notice h5 {
  margin: 0 0 16px;
  color: #174f69;
  font-size: clamp(21px, 2.4vw, 27px);
  font-weight: 700;
  line-height: 1.4;
}

.hx-single-course-notice p,
.hx-single-course-notice li {
  font-size: 16px;
  line-height: 1.75;
}

.hx-single-course-notice p {
  margin: 0 0 16px;
}

.hx-single-course-notice ol {
  margin: 4px 0 18px;
  padding-left: 25px;
}

.hx-single-course-notice li + li {
  margin-top: 14px;
}

.hx-single-course-notice strong,
.hx-single-course-notice li span {
  display: block;
}

.hx-single-course-notice strong {
  margin-bottom: 2px;
  color: #174f69;
}

.hx-single-course-notice .hx-single-course-notice-closing {
  margin-bottom: 0;
  font-weight: 700;
}

.online-application[data-program="single-course"] {
  max-width: 700px;
  margin: 54px auto 74px;
  padding: 0;
}

.online-application[data-program="single-course"] .apply-choice-group {
  display: grid;
  gap: 10px;
}

.online-application[data-program="single-course"] .apply-choice {
  width: 100%;
  padding: 12px 14px;
  align-items: flex-start;
  border: 1px solid #d5e0e8;
  border-radius: 8px;
  background: #f8fbfd;
  line-height: 1.55;
}

.online-application[data-program="single-course"] .apply-choice:has(input:checked) {
  border-color: #2f73b8;
  background: #edf6ff;
  box-shadow: 0 0 0 2px rgba(47, 115, 184, 0.12);
}

@media (max-width: 620px) {
  .hx-single-course-download-wrap {
    padding-right: 0;
    padding-left: 0;
  }

  .hx-single-course-download {
    min-height: 0;
    padding: 18px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 15px;
  }

  .hx-single-course-pdf-badge {
    width: 52px;
    height: 62px;
    font-size: 16px;
  }

  .hx-single-course-download-title {
    font-size: 18px;
  }

  .hx-single-course-download-action {
    grid-column: 2;
    justify-self: start;
  }

  .hx-single-course-notice {
    margin-top: 24px;
    padding: 21px 20px;
  }

  .online-application[data-program="single-course"] {
    margin-top: 42px;
    padding: 0;
  }
}
