/* The application form. Loaded after landing.css, on /apply only, and built from the
   landing page's tokens (set on body.lp-page). Every class carries the ap- prefix.
   Mobile first: one column, 20px gutters, fields tall enough for a thumb. */

body.ap-page { background: var(--orange); min-height: 100vh; }
.ap-main { max-width: 640px; margin: 0 auto; padding: 14px var(--gutter) 56px; }
.ap-bar { margin-bottom: 22px; }
.ap-bar .lp-login { font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; }

.ap-card { background: var(--paper); border-radius: 26px; padding: 30px 22px 30px; box-shadow: 0 18px 40px rgba(120, 48, 0, 0.26); }
.ap-card h1 { font-size: clamp(2rem, 8.4vw, 2.7rem); line-height: 1.04; }
.ap-card:lang(th) h1 { line-height: 1.25; }
.ap-lede { margin-top: 12px; font-size: 1.08rem; color: var(--on-paper-2); max-width: 46ch; }

.ap-form { margin-top: 26px; display: grid; gap: 20px; }
.ap-field label, .ap-terms legend { display: block; font-size: 1.02rem; font-weight: 600; line-height: 1.3; }
.ap-hint { margin-top: 3px; font-size: 0.92rem; color: var(--on-paper-2); line-height: 1.4; }
.ap-field input {
  display: block; width: 100%; min-height: 56px; margin-top: 8px; padding: 0 16px;
  font: inherit; font-size: 1.08rem; color: var(--ink);
  background: var(--white); border: 2px solid var(--line); border-radius: 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.ap-field input:hover { border-color: #dcc3a8; }
.ap-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(9, 72, 201, 0.16); }
.ap-field.has-error input { border-color: #b3261e; }
.ap-error { margin-top: 6px; font-size: 0.95rem; font-weight: 500; color: #b3261e; }
.ap-banner { margin-top: 18px; padding: 12px 16px; border-radius: 14px; background: #fdecea; color: #8c1d18; font-weight: 500; }

/* Kept out of sight and out of the tab order; display:none would tip off a script. */
.ap-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ap-terms { margin: 0; padding: 18px 16px 16px; border: 2px solid var(--line); border-radius: 18px; background: var(--white); min-width: 0; }
/* The legend is floated so it sits inside the box as a heading; on the border, a title
   that wraps to two lines cuts the border twice. */
.ap-terms legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; }
.ap-terms legend + * { clear: both; }
.ap-terms.has-error { border-color: #b3261e; }
.ap-terms-list { max-height: 240px; overflow-y: auto; padding: 4px 6px 4px 26px; font-size: 0.94rem; line-height: 1.5; color: var(--on-paper-2); }
.lp-page .ap-terms-list { list-style: decimal; }
.ap-terms-list li + li { margin-top: 8px; }
.ap-check { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 12px; border-radius: 12px; background: var(--paper); font-weight: 600; cursor: pointer; }
.ap-check input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--orange-deep); }
.ap-chat {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin-top: 12px; padding: 0 20px;
  border-radius: 999px; background: #06c755; color: var(--white); font-weight: 700; text-decoration: none;
}
.ap-chat:hover { background: #05a847; }
.ap-chat-viber { background: #7360f2; }
.ap-chat-viber:hover { background: #5b49d6; }
.ap-chat-box { margin-top: 26px; padding: 18px 18px 20px; border-radius: 18px; background: var(--white); border: 2px solid var(--line); }
.ap-chat-box h2 { font-size: 1.2rem; line-height: 1.3; letter-spacing: 0; }

.ap-submit { width: 100%; margin-top: 6px; cursor: pointer; }
.ap-note { text-align: center; font-size: 0.95rem; color: var(--on-paper-2); }
.ap-privacy { text-align: center; font-size: 0.85rem; color: var(--on-paper-2); line-height: 1.45; }
.ap-privacy a { font-weight: 600; }

.ap-done .ap-submit { margin-top: 26px; }
.ap-next { margin-top: 24px; display: grid; gap: 14px; counter-reset: ap-step; }
.ap-next li { position: relative; padding-left: 48px; min-height: 34px; display: flex; align-items: center; }
.ap-next li::before {
  counter-increment: ap-step; content: counter(ap-step);
  position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--yellow); font-weight: 800;
}
.ap-back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 22px; font-weight: 600; }

.ap-help { margin-top: 22px; text-align: center; font-size: 0.98rem; color: #3b2410; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
.ap-help a { font-weight: 600; }

@media (min-width: 700px) {
  .ap-main { padding-top: 22px; }
  .ap-card { padding: 44px 44px 40px; }
}
