/*
 * MySynergy Internship Application — style.css
 * Visual language inherited from BRAND_GUIDE.md v1.1 + report.css
 * Surfaces: index.html (form), thank-you.html (confirmation)
 */

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333333;
  background: #FAFAFA;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a, a:visited {
  color: #0B66C2;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ----- Header ----- */
.brand-header {
  background: #043B01;
  color: #FFFFFF;
  padding: 28px 24px;
  border-bottom: 4px solid #032A01;
}

.brand-header__inner {
  max-width: 880px;
  margin: 0 auto;
}

.brand-header__wordmark {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}

.brand-header__legal {
  font-size: 13px;
  font-weight: 400;
  margin: 4px 0 0 0;
  color: #DCEAD8;
}

/* ----- Page container ----- */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 64px 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #043B01;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.page-subtitle {
  font-size: 14px;
  color: #666666;
  margin: 0 0 28px 0;
}

/* ----- Card ----- */
.card {
  background: #FFFFFF;
  border: 1px solid #E2E2E2;
  border-radius: 4px;
  padding: 28px 32px;
  margin-bottom: 20px;
}

/* ----- Form sections ----- */
.section {
  margin-bottom: 28px;
}

.section + .section {
  border-top: 1px solid #EDEDED;
  padding-top: 24px;
}

.section__title {
  font-size: 16px;
  font-weight: 700;
  color: #043B01;
  margin: 0 0 4px 0;
}

.section__hint {
  font-size: 13px;
  color: #666666;
  margin: 0 0 16px 0;
}

/* ----- Field grid ----- */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

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

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 6px;
}

.field .required {
  color: #C0272D;
  margin-left: 2px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="date"],
.field select,
.field textarea {
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid #CCCCCC;
  border-radius: 3px;
  background: #FFFFFF;
  color: #333333;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  width: 100%;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #043B01;
  box-shadow: 0 0 0 2px rgba(4, 59, 1, 0.12);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #C0272D;
}

.field__error {
  display: none;
  font-size: 12px;
  color: #C0272D;
  margin-top: 4px;
}

.field--invalid .field__error {
  display: block;
}

/* ----- Checkbox stack (acknowledgements) ----- */
.ack-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ack {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #FAFAFA;
  border: 1px solid #EDEDED;
  border-radius: 3px;
}

.ack input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: #043B01;
}

.ack label {
  font-size: 13px;
  color: #333333;
  line-height: 1.45;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

.ack--invalid {
  border-color: #C0272D;
  background: #FDF2F2;
}

/* ----- Turnstile + submit row ----- */
.submit-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  margin-top: 8px;
}

.submit-row .turnstile-wrap {
  min-height: 65px;
}

button.btn-submit {
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  background: #043B01;
  color: #FFFFFF;
  padding: 12px 28px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.12s ease, opacity 0.12s ease;
}

button.btn-submit:hover:not(:disabled) {
  background: #032A01;
}

button.btn-submit:disabled {
  background: #999999;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ----- Form-level message banner ----- */
.form-message {
  display: none;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 3px;
  font-size: 14px;
  border: 1px solid;
}

.form-message--error {
  display: block;
  background: #FDF2F2;
  border-color: #C0272D;
  color: #8A1F23;
}

.form-message--info {
  display: block;
  background: #F1F7EE;
  border-color: #043B01;
  color: #1F3F12;
}

/* ----- Stage 3 draft save & restore ----- */

/* Secondary outlined button — Save & continue later, restore-banner Yes button. */
button.btn-secondary {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  background: #FFFFFF;
  color: #043B01;
  padding: 11px 20px;
  border: 1.5px solid #043B01;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}
button.btn-secondary:hover:not(:disabled) {
  background: #F1F7EE;
}
button.btn-secondary:disabled {
  border-color: #999999;
  color: #999999;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Plain text-link button — Discard / Start fresh. */
button.btn-link {
  font: inherit;
  font-size: 13px;
  background: transparent;
  color: #666666;
  padding: 8px 12px;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}
button.btn-link:hover {
  color: #C0272D;
}

/* Restore banner shown above form when a draft is found. */
.draft-restore {
  background: #FFFBEB;
  border: 1px solid #E5C766;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.draft-restore__title {
  display: block;
  color: #6B4D00;
  font-size: 15px;
  margin-bottom: 4px;
}
.draft-restore__details {
  margin: 0;
  font-size: 13px;
  color: #5C4400;
}
.draft-restore__note {
  margin: 0;
  font-size: 12px;
  color: #7A5A00;
  font-style: italic;
}
.draft-restore__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Submit row override on the Q&A page — vertical stack with two buttons. */
.submit-row--qa {
  align-items: stretch;
}
.submit-row__buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.draft-files-note {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #5A5A5A;
  background: #FAFAFA;
  border-left: 3px solid #043B01;
  padding: 8px 12px;
  border-radius: 0 3px 3px 0;
}
.save-status {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
  font-size: 12px;
  color: #666666;
}
.save-status__chunk {
  display: inline-block;
}
.save-status__chunk + .save-status__chunk::before {
  content: "|";
  color: #CCCCCC;
  margin-right: 14px;
  margin-left: -14px;
  /* Pseudo-element acts as separator without an extra DOM node. */
}

/* ----- Thank-you page ----- */
.thanks {
  text-align: left;
}

.thanks__hero {
  background: #043B01;
  color: #FFFFFF;
  padding: 36px 32px;
  border-radius: 4px;
  margin-bottom: 24px;
}

.thanks__hero h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.thanks__hero p {
  font-size: 14px;
  color: #DCEAD8;
  margin: 0;
}

.appid-box {
  background: #FAFAFA;
  border: 1px dashed #043B01;
  border-radius: 4px;
  padding: 20px 24px;
  margin: 24px 0;
  text-align: center;
}

.appid-box__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666666;
  margin: 0 0 6px 0;
}

.appid-box__id {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 24px;
  font-weight: 700;
  color: #043B01;
  margin: 0;
  letter-spacing: 0.02em;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 56px;
  margin-bottom: 10px;
  background: #FFFFFF;
  border: 1px solid #EDEDED;
  border-radius: 3px;
  font-size: 14px;
  color: #333333;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #043B01;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps li strong {
  display: block;
  color: #043B01;
  font-size: 14px;
  margin-bottom: 2px;
}

.thanks__footer-note {
  margin-top: 24px;
  padding: 14px 16px;
  background: #FFFCEB;
  border-left: 3px solid #C47900;
  font-size: 13px;
  color: #5A4400;
}

.thanks__follow-cta {
  margin-top: 24px;
  padding: 16px 20px;
  background: #F0F4EE;
  border-left: 3px solid #043B01;
  font-size: 14px;
  color: #14140F;
  line-height: 1.55;
}
.thanks__follow-cta a {
  color: #043B01;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ----- Identity summary (Stage 2 prefilled identity panel) ----- */
.identity-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 24px;
}

.identity-summary__row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}

.identity-summary__label {
  flex-shrink: 0;
  width: 150px;
  color: #666666;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.identity-summary__value {
  color: #043B01;
  font-weight: 600;
  word-break: break-word;
}

/* ----- Back-link button (error-state on continue.html) ----- */
.btn-link-back {
  display: inline-block;
  background: #043B01;
  color: #FFFFFF !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

.btn-link-back:hover {
  background: #032A01;
}

/* ----- Page footer ----- */
.page-footer {
  text-align: center;
  font-size: 12px;
  color: #666666;
  padding: 24px 16px 32px 16px;
}

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .brand-header { padding: 22px 18px; }
  .brand-header__wordmark { font-size: 21px; }
  .brand-header__legal { font-size: 12px; }
  .container { padding: 22px 16px 48px 16px; }
  .card { padding: 20px 18px; }
  .field-grid { grid-template-columns: 1fr; gap: 14px; }
  .page-title { font-size: 20px; }
  .thanks__hero { padding: 26px 20px; }
  .thanks__hero h2 { font-size: 19px; }
  .appid-box__id { font-size: 20px; }
  .identity-summary__row { flex-direction: column; gap: 2px; }
  .identity-summary__label { width: auto; }
}

/* ----- Stage 1 program intro ----- */
.program-intro {
  margin-bottom: 24px;
  background: #FAFAF7;
  border-left: 4px solid #043B01;
}
.program-intro p {
  font-size: 14.5px;
  line-height: 1.55;
  color: #2a2a2a;
  margin: 10px 0;
}
.program-intro .equal-opps {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #cccccc;
  font-size: 13px;
  color: #555555;
}

/* "Not from a Hong Kong university?" footer link */
.non-hk-link {
  margin-top: 18px;
  padding: 14px 16px;
  background: #FFFAEC;
  border-left: 3px solid #C8A100;
  font-size: 13.5px;
  color: #5a4a00;
}
.non-hk-link a {
  color: #043B01;
  font-weight: 600;
  text-decoration: underline;
}

/* ----- Resend-email row (check-email.html) ----- */
.resend-row {
  margin-top: 24px;
  padding: 16px 20px;
  background: #FFFFFF;
  border: 1px solid #E2E2E2;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.resend-row button.btn-submit {
  font-size: 14px;
  padding: 9px 22px;
}
.resend-status {
  margin: 0;
  font-size: 13px;
  color: #666666;
  line-height: 1.5;
  min-height: 1em;
}
.resend-status--ok {
  color: #1F6D1A;
}
.resend-status--err {
  color: #8A1F23;
}

/* ----- Already-submitted state (continue.html / qa.html) ----- */
.already-submitted {
  border-left: 4px solid #043B01;
  background: #F4F8F2;
}
.already-submitted .page-title {
  color: #043B01;
}

/* ----- Q&A page ----- */
.qa-questions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.qa-question {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qa-question label {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  line-height: 1.45;
}
.qa-question__num {
  display: inline-block;
  background: #043B01;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  text-align: center;
  line-height: 22px;
  margin-right: 6px;
  flex-shrink: 0;
}
.qa-question__label {
  font-weight: 500;
  color: #333333;
}
.qa-question textarea {
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid #CCCCCC;
  border-radius: 3px;
  background: #FFFFFF;
  color: #333333;
  min-height: 96px;
  resize: vertical;
  width: 100%;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.qa-question textarea:focus {
  outline: none;
  border-color: #043B01;
  box-shadow: 0 0 0 2px rgba(4, 59, 1, 0.12);
}
.qa-question textarea[aria-invalid="true"] {
  border-color: #C0272D;
}
.qa-counter {
  font-size: 12px;
  color: #999999;
  align-self: flex-end;
}
.qa-counter--warn {
  color: #C47900;
  font-weight: 600;
}

/* ----- Q&A page: stage 3 sections (video + credentials + questions) ----- */
.qa-section {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid #EAEAEA;
}
.qa-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 22px;
}
.qa-section__title {
  font-size: 17px;
  font-weight: 700;
  color: #043B01;
  margin: 0 0 8px 0;
}
.qa-section__prompt {
  font-size: 14px;
  line-height: 1.55;
  color: #333333;
  margin: 0 0 14px 0;
  padding: 12px 14px;
  background: #F4F8F4;
  border-left: 3px solid #043B01;
  border-radius: 2px;
}
.qa-section__prompt em {
  color: #043B01;
  font-style: italic;
  font-weight: 600;
}
.qa-section__privacy {
  font-size: 12px;
  line-height: 1.5;
  color: #666666;
  margin: 0 0 12px 0;
  padding: 8px 10px;
  background: #FAFAFA;
  border: 1px dashed #D0D0D0;
  border-radius: 3px;
}

/* Highlight the video upload — biggest piece of the stage. */
.qa-section--video .field--upload {
  background: #FFFFFF;
  border: 2px dashed #043B01;
  border-radius: 6px;
  padding: 14px;
}
.qa-section--video .field--upload label {
  color: #043B01;
  font-weight: 700;
}

/* File upload field generally — used by all three Stage 3 file inputs. */
.field--upload input[type="file"] {
  font-size: 13px;
  padding: 6px 0;
}
.file-hint {
  display: block;
  font-size: 12px;
  color: #666666;
  margin-top: 4px;
  line-height: 1.5;
}
.file-hint code {
  background: #F2F2F2;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 12px;
}
.optional {
  font-size: 12px;
  font-weight: 400;
  color: #999999;
  margin-left: 4px;
}

/* Upload progress bar (video only — it's the heaviest payload). */
.upload-progress {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.upload-progress__bar {
  height: 8px;
  background: #EAEAEA;
  border-radius: 4px;
  overflow: hidden;
}
.upload-progress__fill {
  height: 100%;
  width: 0%;
  background: #043B01;
  transition: width 0.18s ease;
}
.upload-progress__label {
  font-size: 12px;
  color: #666666;
}

/* ----- API docs page ----- */
.api-docs .page-subtitle code {
  background: #F2F2F2;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}
.api-section {
  margin-bottom: 22px;
}
.api-section .section__title {
  font-size: 17px;
  margin-bottom: 12px;
}
.api-bullets {
  margin: 0 0 0 18px;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #333333;
}
.api-bullets li { margin-bottom: 6px; }
.api-bullets code,
.api-section code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  background: #F2F2F2;
  padding: 1px 5px;
  border-radius: 3px;
  color: #043B01;
}
.api-endpoint {
  border-top: 1px solid #EDEDED;
  padding: 18px 0 4px 0;
}
.api-endpoint:first-of-type {
  border-top: none;
  padding-top: 0;
}
.api-endpoint p {
  font-size: 14px;
  line-height: 1.55;
  color: #333333;
}
.api-endpoint__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.api-method {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 3px;
  color: #FFFFFF;
  text-transform: uppercase;
}
.api-method--get  { background: #0B66C2; }
.api-method--post { background: #043B01; }
.api-path {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: 13.5px;
  color: #043B01;
  background: #F4F8F2;
  padding: 3px 7px;
  border-radius: 3px;
  word-break: break-all;
}
.api-endpoint h4 {
  font-size: 13px;
  font-weight: 700;
  color: #043B01;
  margin: 14px 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.api-endpoint pre {
  background: #F8F8F8;
  border: 1px solid #EDEDED;
  border-radius: 3px;
  padding: 12px 14px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #333333;
  overflow-x: auto;
  margin: 0 0 8px 0;
}
.api-endpoint pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.api-hint {
  font-size: 13px;
  color: #666666;
  font-style: italic;
  margin: 6px 0 0 0;
}
.api-errors {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.api-errors th,
.api-errors td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #EDEDED;
}
.api-errors th {
  background: #F4F8F2;
  color: #043B01;
  font-weight: 700;
}
.api-errors td:first-child {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
  width: 70px;
  color: #043B01;
}

/* ----- Q&A page: character & preferences (40 forced-choice) ----- */
.character-questions {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.character-subsection {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: #FAFAF7;
  border: 1px solid #EAEAEA;
  border-radius: 4px;
}
.character-subsection__title {
  font-size: 14px;
  font-weight: 700;
  color: #043B01;
  margin: 0 0 4px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #E0E5DD;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.character-question {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.character-question__label {
  font-size: 14px;
  font-weight: 500;
  color: #333333;
  line-height: 1.45;
}
.character-question__num {
  display: inline-block;
  background: #043B01;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 11px;
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 6px;
  vertical-align: 1px;
}
.character-question__text {
  font-weight: 500;
  color: #333333;
}
.character-question__select,
.character-question__text-input {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #CCCCCC;
  border-radius: 3px;
  background: #FFFFFF;
  color: #333333;
  width: 100%;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.character-question__select:focus,
.character-question__text-input:focus {
  outline: none;
  border-color: #043B01;
  box-shadow: 0 0 0 2px rgba(4, 59, 1, 0.12);
}
.character-question__select[aria-invalid="true"],
.character-question__text-input[aria-invalid="true"] {
  border-color: #C0272D;
}
