:root {
  --tl-primary: #0182fa;
  --tl-primary-dark: #0072d8;
  --tl-primary-soft: #76c4ff;
  --tl-warm: #e5775a;
  --tl-have: #364b96;
  --tl-navy: #032b42;
  --tl-navy-2: #073856;
  --tl-ink: #0e4a68;
  --tl-bg: #f1f8ff;
  --tl-line: #d9ecff;
  --tl-white: #ffffff;
  --tl-muted: #698399;
  --tl-shadow: 0 18px 50px rgba(3, 43, 66, .14);
}

* { box-sizing: border-box; }

html { background: #dfefff; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--tl-navy);
  background:
    radial-gradient(circle at 15% 10%, rgba(118, 196, 255, .35), transparent 32%),
    linear-gradient(135deg, #eaf5ff 0%, #f8fbff 52%, #dceeff 100%);
  font-family: "Kanit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("https://www.travellink.go.th/assets/Welcome-CEvWs-gZ.svg");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: min(1600px, 140vw) auto;
  opacity: .10;
  filter: saturate(0) sepia(1) hue-rotate(160deg) saturate(5);
}

button, input, select, textarea { font: inherit; }

.app-stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

.app-loader {
  display: grid;
  place-items: center;
  min-height: 100dvh;
}

body:not(.is-loading) .app-loader { display: none; }

.agenda-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

.agenda-artworks {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.agenda-image-link {
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(3, 43, 66, .08);
  text-decoration: none;
}

.agenda-image-link img {
  display: block;
  width: 100%;
  height: auto;
}

.agenda-bottom {
  padding: 18px 16px 22px;
  background: linear-gradient(180deg, #f1f8ff 0%, #edf7ff 100%);
}

.agenda-bottom .travel-link-cta { margin-top: 0; }

.invalid-code-notice {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 120;
  max-width: 398px;
  margin: 0 auto;
  padding: 11px 14px;
  color: #9e3c28;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(229,119,90,.45);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(3,43,66,.14);
  font-size: 13px;
  text-align: center;
}

.profile-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: visible;
  background: linear-gradient(180deg, #f1f8ff 0%, #ffffff 46%, #edf7ff 100%);
}

.event-kv {
  position: sticky;
  top: 0;
  z-index: 80;
  aspect-ratio: 4 / 1;
  overflow: hidden;
  background: var(--tl-primary);
  transition: box-shadow .2s ease;
}

.event-kv.is-scrolled { box-shadow: 0 7px 22px rgba(3,43,66,.20); }

.event-kv::after {
  display: none;
}

.event-kv a { display: block; width: 100%; height: 100%; }

.event-kv img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-body {
  position: relative;
  padding: 0 16px 22px;
}

.profile-body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("https://www.travellink.go.th/assets/Welcome-CEvWs-gZ.svg");
  background-repeat: no-repeat;
  background-position: center 82%;
  background-size: 760px auto;
  opacity: .045;
}

.profile-label-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 17px 4px 10px;
}

.profile-label {
  margin: 0;
  padding: 0;
  color: var(--tl-primary);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .01em;
}

.agenda-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 13px;
  color: var(--tl-primary);
  background: rgba(255,255,255,.82);
  border: 1px solid var(--tl-primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.identity-card,
.network-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(1, 130, 250, .11);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(3, 43, 66, .08);
}

.identity-card { padding: 21px 20px 18px; }

.identity-card {
  position: relative;
  overflow: hidden;
  border-color: var(--tl-primary);
}

.identity-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--tl-primary);
}

.eyebrow {
  margin: 0;
  color: var(--tl-primary);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.section-kicker,
.modal-kicker {
  margin: 0;
  color: var(--tl-primary);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.identity-card h1 {
  margin: 6px 0 0;
  color: var(--tl-navy);
  font-size: 24px;
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -.025em;
}

.identity-rule {
  width: 100%;
  height: 1px;
  margin: 20px 0 16px;
  background: #ccd9e5;
  border-radius: 0;
}

.identity-category {
  margin: 0;
  color: var(--tl-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.identity-company {
  margin: 4px 0 0;
  color: var(--tl-navy);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.identity-rule-email { margin-top: 22px; margin-bottom: 16px; }

.email-link {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--tl-navy);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}

.email-link small {
  display: block;
  color: var(--tl-primary);
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1;
}

.email-link > .fa-arrow-up-right { margin-left: auto; color: var(--tl-primary); }

.section-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(180deg, #3ea3ff 0%, #0072d8 100%);
  box-shadow: none;
}

.email-icon {
  width: 20px;
  flex: 0 0 20px;
  color: var(--tl-primary);
  background: none;
  font-size: 18px;
  text-align: center;
}

.network-card {
  position: relative;
  margin-top: 14px;
  padding: 17px;
  overflow: hidden;
}

.network-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--tl-have);
}

.need-card::before { background: var(--tl-warm); }

.section-heading { display: flex; align-items: center; gap: 11px; }
.section-icon { width: 39px; height: 39px; border-radius: 10px; font-size: 17px; }
.have-card { border-color: rgba(54, 75, 150, .20); }
.need-card { border-color: rgba(229, 119, 90, .20); }
.have-card .section-icon { background: var(--tl-have); }
.need-card .section-icon { background: var(--tl-warm); }
.have-card .section-kicker { color: var(--tl-have); }
.need-card .section-kicker { color: var(--tl-warm); }

.section-heading h2 {
  margin: 2px 0 0;
  color: var(--tl-navy);
  font-size: 18px;
  font-weight: 800;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.data-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: var(--tl-ink);
  background: #f0f8ff;
  border: 1px solid #d6ebff;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 400;
}

.data-tag i {
  color: currentColor;
  background: none;
}
.have-card .data-tag {
  color: var(--tl-have);
  background: rgba(54, 75, 150, .08);
  border-color: rgba(54, 75, 150, .20);
}
.need-card .data-tag {
  color: var(--tl-warm);
  background: rgba(229, 119, 90, .08);
  border-color: rgba(229, 119, 90, .20);
}

.journey-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #cfe4f7;
}

.have-card .journey-row { border-top-color: rgba(54, 75, 150, .28); }
.need-card .journey-row { border-top-color: rgba(229, 119, 90, .28); }

.journey-label {
  display: block;
  margin-bottom: 7px;
  color: var(--tl-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.journey-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.journey-tags span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  color: var(--tl-primary-dark);
  background: #fff;
  border: 1px solid rgba(1, 130, 250, .25);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 400;
}

.have-card .journey-label,
.have-card .journey-tags span { color: var(--tl-have); }
.have-card .journey-tags span {
  background: rgba(54, 75, 150, .07);
  border-color: rgba(54, 75, 150, .24);
}
.need-card .journey-label,
.need-card .journey-tags span { color: var(--tl-warm); }
.need-card .journey-tags span {
  background: rgba(229, 119, 90, .07);
  border-color: rgba(229, 119, 90, .24);
}

.actions { margin-top: 16px; }

.btn-connect {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 18px;
  color: #fff;
  background: #0182fa;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(3, 43, 66, .08);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
}

.button-copy { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.button-copy strong { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 18px; line-height: 1.2; }
.button-copy small { font-size: 13px; line-height: 1.3; font-weight: 400; letter-spacing: 0; opacity: .86; }
.btn-connect:active { transform: translateY(1px); }

.btn-save-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 9px;
  padding: 15px 18px;
  color: var(--tl-primary);
  background: #fff;
  border: 1px solid var(--tl-primary);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(3, 43, 66, .08);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .05em;
}

.btn-save-contact .button-copy small { color: var(--tl-navy); opacity: .65; }

.travel-link-cta {
  display: block;
  margin-top: 18px;
  overflow: hidden;
  background: #fff;
  border: 3px solid var(--tl-primary);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(3, 43, 66, .08);
  text-decoration: none;
}

.travel-link-cta img { display: block; width: 100%; height: auto; }

.profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding: 0 3px;
  color: #86a3ba;
  font-size: 9px;
  font-weight: 600;
}

.profile-footer a { color: var(--tl-primary); text-decoration: none; }
.profile-footer a { font-size: 12px; }

.connect-modal {
  margin: 12px;
  color: var(--tl-navy);
  border: 0;
  border-radius: 10px;
  box-shadow: var(--tl-shadow);
}

.connect-modal .modal-header { padding: 23px 22px 13px; }
.connect-modal .modal-title { margin-top: 5px; font-size: 24px; font-weight: 800; }
.connect-modal .modal-body { padding: 10px 22px 24px; }
.connect-modal .modal-footer { padding: 18px 22px 22px; }
.form-label { color: var(--tl-navy); font-size: 16px; font-weight: 700; }
.form-control, .form-select { border-color: #b9d8f4; border-radius: 10px; font-size: 16px; }
.form-control::placeholder { color: var(--tl-muted); opacity: .65; }
.form-control:focus, .form-select:focus { border-color: var(--tl-primary); box-shadow: 0 0 0 .2rem rgba(1,130,250,.12); }

.clear-shell {
  width: calc(100% - 32px);
  max-width: 430px;
  margin: 32px auto;
  overflow: hidden;
  background: linear-gradient(180deg, #f1f8ff 0%, #fff 100%);
  border-radius: 10px;
  box-shadow: var(--tl-shadow);
}

.clear-body { padding: 28px 22px 30px; text-align: center; }
.clear-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: #fff;
  background: var(--tl-primary);
  border-radius: 50%;
  font-size: 24px;
}
.clear-body h1 { margin: 0 0 8px; color: var(--tl-navy); font-size: 24px; font-weight: 800; }
.clear-body p { margin: 0 0 22px; color: var(--tl-muted); font-size: 15px; line-height: 1.55; }
.clear-home {
  display: block;
  padding: 13px 16px;
  color: #fff;
  background: var(--tl-primary);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.form-hint {
  margin: 8px 0 18px;
  color: var(--tl-muted);
  font-size: 13px;
  line-height: 1.45;
}

.verification-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: #a23d27;
  background: rgba(229,119,90,.12);
  border: 1px solid rgba(229,119,90,.28);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.btn-modal-submit {
  width: 100%;
  padding: 12px;
  color: #fff;
  background: var(--tl-primary);
  border: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
}

.btn-modal-back {
  display: block;
  width: 100%;
  margin-top: 11px;
  padding: 6px;
  color: var(--tl-primary-dark);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 500;
}

#profileToast { color: #fff; background: var(--tl-navy); border-radius: 10px; }

@media (min-width: 768px) {
  .app-stage { padding: 34px 18px; }

  .profile-shell,
  .agenda-shell {
    min-height: auto;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 10px;
    box-shadow: 0 30px 90px rgba(3, 43, 66, .22);
  }

  .event-kv { border-radius: 10px 10px 0 0; }
  .agenda-shell { overflow: hidden; }
}

@media (max-width: 360px) {
  .profile-body { padding-inline: 12px; }
  .identity-card { padding-inline: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .profile-shell { animation: card-enter .55s ease-out both; }
  .btn-connect, .btn-save-contact, .travel-link-cta { transition: transform .18s ease, border-color .18s ease; }
  .btn-save-contact:hover, .travel-link-cta:hover { transform: translateY(-2px); }
  @keyframes card-enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
}
