/* #Supachai 23 ก.ค. 2569 */
/* Thai Journey — Andaman teal × marigold on warm sand. Prompt display + Anuphan body. */

:root {
  --ink: #21302e;
  --ink-soft: #5c6b68;
  --cream: #f7eeda;
  --paper: #fffdf6;
  --teal-950: #082e2f;
  --teal-900: #0b3b3c;
  --teal-700: #14595c;
  --teal-500: #1d7d7a;
  --teal-100: #d8ebe6;
  --gold: #f2a93b;
  --gold-deep: #cf7f1d;
  --coral: #d4573b;
  --green-ok: #2e8b57;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px -12px rgba(8, 46, 47, .25);
  --shadow-sm: 0 4px 14px -6px rgba(8, 46, 47, .18);
  --font-display: 'Prompt', 'Anuphan', -apple-system, sans-serif;
  --font-body: 'Anuphan', -apple-system, 'Segoe UI', sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 62px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -80px, rgba(242, 169, 59, .14), transparent 60%),
    var(--cream);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

#app { min-height: 100dvh; display: flex; flex-direction: column; }

.view {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-h) + var(--sab) + 20px);
  animation: page-in .3s cubic-bezier(.22, .9, .3, 1);
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

h1, h2, h3, .display { font-family: var(--font-display); }

/* ---------- hero header ---------- */
.hero {
  background:
    radial-gradient(500px 240px at 90% -60px, rgba(242, 169, 59, .35), transparent 65%),
    linear-gradient(160deg, var(--teal-950), var(--teal-700));
  color: #f4f1e6;
  padding: calc(var(--sat) + 22px) 20px 58px;
  border-radius: 0 0 30px 30px;
  position: relative;
  overflow: hidden;
}
.hero::after { /* prajam-yam diamond lattice */
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(45deg, transparent 46%, rgba(247, 238, 218, .05) 47%, rgba(247, 238, 218, .05) 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(247, 238, 218, .05) 47%, rgba(247, 238, 218, .05) 53%, transparent 54%);
  background-size: 26px 26px;
  pointer-events: none;
}
.hero .greeting { font-size: .95rem; opacity: .82; letter-spacing: .02em; }
.hero h1 { font-size: 1.7rem; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.hero .brand {
  position: absolute; top: calc(var(--sat) + 22px); right: 20px;
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-size: .8rem; font-weight: 500;
  color: var(--gold); letter-spacing: .06em;
}
.hero .brand img { width: 26px; height: 26px; border-radius: 8px; }

/* header bar for inner pages */
.pagehead {
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--sat) + 14px) 16px 12px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(to bottom, var(--cream) 75%, transparent);
}
.pagehead h2 { font-size: 1.15rem; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-back {
  width: 38px; height: 38px; flex: none;
  border: none; border-radius: 12px;
  background: var(--paper); color: var(--teal-700);
  box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
  font-size: 1.15rem; cursor: pointer;
}

/* ---------- search card ---------- */
.search-card {
  margin: -38px 16px 0;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative; z-index: 5;
  overflow: hidden;
}
.seg {
  display: flex; gap: 4px;
  padding: 8px;
  background: linear-gradient(to bottom, rgba(8, 46, 47, .045), transparent);
}
.seg button {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-display); font-size: .86rem; font-weight: 500;
  color: var(--ink-soft);
  padding: 9px 4px;
  border-radius: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .18s;
}
.seg button.active {
  background: var(--teal-900);
  color: var(--gold);
  box-shadow: var(--shadow-sm);
}
.seg .ico { font-size: 1rem; }

.search-body { padding: 14px 16px 16px; display: grid; gap: 10px; }
.field { position: relative; }
.field label {
  display: block;
  font-size: .72rem; font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .04em;
  margin: 0 0 3px 2px;
  text-transform: uppercase;
}
.field select, .field input {
  width: 100%;
  font-family: var(--font-body); font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #e6ddc8;
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  appearance: none;
  outline: none;
  transition: border-color .15s;
}
.field select:focus, .field input:focus { border-color: var(--teal-500); }
.field.select::after {
  content: '▾';
  position: absolute; right: 13px; bottom: 12px;
  color: var(--ink-soft); pointer-events: none; font-size: .85rem;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-swap { display: grid; grid-template-columns: 1fr 42px 1fr; gap: 6px; align-items: end; }
.btn-swap {
  height: 44px; border: none; border-radius: 12px;
  background: var(--teal-100); color: var(--teal-700);
  font-size: 1.05rem; cursor: pointer;
}

.btn-primary {
  width: 100%;
  border: none;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  color: var(--teal-950);
  background: linear-gradient(135deg, var(--gold), #f6c064);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(207, 127, 29, .55);
  transition: transform .12s;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .55; }

.btn-ghost {
  width: 100%;
  border: 1.5px solid var(--teal-700);
  background: transparent;
  color: var(--teal-700);
  font-family: var(--font-display); font-size: 1rem; font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
}

/* ---------- popular chips ---------- */
.section-title {
  font-size: 1.02rem; font-weight: 600;
  margin: 22px 20px 10px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 4px; height: 18px;
  background: var(--gold); border-radius: 2px;
}
.chip-scroll {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 2px 16px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.dest-chip {
  flex: none;
  width: 118px; height: 130px;
  border: none; border-radius: 16px;
  position: relative; overflow: hidden;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-display);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-end;
  padding: 10px;
  text-align: left;
}
.dest-chip .nm { font-size: .92rem; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.dest-chip .ico { position: absolute; top: 10px; right: 10px; font-size: 1.35rem; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }

/* ---------- result cards ---------- */
.cards { display: grid; gap: 12px; padding: 4px 16px; }
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  color: var(--ink);
  cursor: pointer;
  animation: page-in .35s both;
}
.cards .card:nth-child(2) { animation-delay: .05s; }
.cards .card:nth-child(3) { animation-delay: .1s; }
.cards .card:nth-child(4) { animation-delay: .15s; }
.cards .card:nth-child(n+5) { animation-delay: .2s; }
.card:active { transform: scale(.985); }

/* flight card */
.f-card { padding: 14px 16px; width: 100%; }
.f-top { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-soft); }
.f-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.f-route { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.f-time { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1.1; }
.f-port { font-size: .74rem; color: var(--ink-soft); letter-spacing: .05em; }
.f-mid { flex: 1; text-align: center; position: relative; color: var(--teal-500); font-size: .72rem; }
.f-mid::before {
  content: '';
  display: block;
  border-top: 2px dashed #d9cfb6;
  position: absolute; left: 4px; right: 4px; top: 50%;
}
.f-mid span { position: relative; background: var(--paper); padding: 0 8px; }
.f-bottom { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.f-seats { font-size: .76rem; color: var(--coral); }
.price { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--teal-700); }
.price small { font-family: var(--font-body); font-weight: 400; font-size: .74rem; color: var(--ink-soft); }

/* hotel / activity card with gradient photo */
.ph-card { width: 100%; }
.ph {
  height: 128px;
  position: relative;
  display: flex; align-items: flex-end;
  padding: 10px 14px;
}
.ph .badge {
  position: absolute; top: 10px; left: 12px;
  background: rgba(8, 46, 47, .55);
  backdrop-filter: blur(4px);
  color: var(--gold);
  font-size: .74rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
}
.ph .em { position: absolute; right: 14px; bottom: 10px; font-size: 2rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.ph-body { padding: 12px 14px 14px; }
.ph-body h3 { font-size: 1.02rem; font-weight: 600; line-height: 1.3; }
.ph-body .sub { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }
.ph-body .foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.rating {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .8rem; font-weight: 600; color: var(--gold-deep);
}

/* filter chips row */
.filters {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 8px 16px 10px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.fchip {
  flex: none;
  border: 1.5px solid #e0d6bf;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-body); font-size: .84rem; font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.fchip.active { background: var(--teal-900); border-color: var(--teal-900); color: var(--gold); }

/* ---------- detail pages ---------- */
.detail-hero {
  height: 210px;
  position: relative;
  display: flex; align-items: flex-end;
  padding: 16px;
  color: #fff;
}
.detail-hero h2 { font-size: 1.35rem; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.detail-hero .em { position: absolute; top: calc(var(--sat) + 60px); right: 18px; font-size: 3rem; filter: drop-shadow(0 3px 6px rgba(0,0,0,.3)); }
.detail-hero .btn-back { position: absolute; top: calc(var(--sat) + 14px); left: 16px; }
.detail-body { padding: 16px; display: grid; gap: 14px; }
.panel {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.panel h3 { font-size: .98rem; font-weight: 600; margin-bottom: 8px; }
.amenities { display: flex; flex-wrap: wrap; gap: 7px; }
.amenities span {
  font-size: .78rem;
  background: var(--teal-100); color: var(--teal-700);
  padding: 4px 10px; border-radius: 999px;
}
.room-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0;
  border-top: 1px dashed #e3dac4;
}
.room-row:first-of-type { border-top: none; }
.room-row .info { flex: 1; min-width: 0; }
.room-row .nm { font-weight: 600; font-size: .95rem; }
.room-row .meta { font-size: .78rem; color: var(--ink-soft); }
.btn-small {
  border: none;
  background: var(--teal-900); color: var(--gold);
  font-family: var(--font-display); font-size: .85rem; font-weight: 500;
  padding: 9px 14px; border-radius: 11px;
  cursor: pointer;
  flex: none;
}

/* stepper */
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 34px; height: 34px;
  border: 1.5px solid #e0d6bf; border-radius: 10px;
  background: var(--paper);
  font-size: 1.1rem; color: var(--teal-700);
  cursor: pointer;
}
.stepper .val { min-width: 26px; text-align: center; font-weight: 600; }

/* ---------- booking flow ---------- */
.book-body { padding: 12px 16px; display: grid; gap: 14px; }
.summary-strip {
  background: linear-gradient(135deg, var(--teal-900), var(--teal-700));
  color: #f4f1e6;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.summary-strip .t { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.summary-strip .s { font-size: .8rem; opacity: .8; margin-top: 2px; }
.pay-note {
  font-size: .8rem;
  color: var(--gold-deep);
  background: rgba(242, 169, 59, .13);
  border: 1px dashed var(--gold);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  text-align: center;
}
.total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-display);
  padding: 4px 2px;
}
.total-row .amt { font-size: 1.5rem; font-weight: 700; color: var(--teal-700); }

/* ---------- ticket / confirm ---------- */
.ticket-wrap { padding: 26px 22px; display: grid; gap: 16px; justify-items: center; }
.big-check {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--green-ok); color: #fff;
  display: grid; place-items: center;
  font-size: 2.1rem;
  box-shadow: 0 12px 28px -10px rgba(46, 139, 87, .6);
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.ticket {
  width: 100%;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.ticket .head {
  background: linear-gradient(135deg, var(--teal-950), var(--teal-700));
  color: #f4f1e6;
  padding: 16px;
  font-family: var(--font-display);
}
.ticket .head .t { font-weight: 600; }
.ticket .head .s { font-size: .78rem; opacity: .75; font-family: var(--font-body); margin-top: 2px; }
.ticket .perf {
  position: relative;
  border-top: 2px dashed #ddd3ba;
}
.ticket .perf::before, .ticket .perf::after {
  content: '';
  position: absolute; top: -11px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--cream);
}
.ticket .perf::before { left: -11px; }
.ticket .perf::after { right: -11px; }
.ticket .refzone { padding: 18px 16px 20px; text-align: center; }
.ref-label { font-size: .74rem; color: var(--ink-soft); letter-spacing: .12em; text-transform: uppercase; }
.ref-code {
  font-family: var(--font-display);
  font-size: 2.3rem; font-weight: 700;
  letter-spacing: .18em;
  color: var(--teal-900);
  margin-top: 2px;
}
.ticket canvas { margin: 10px auto 0; display: block; image-rendering: pixelated; border-radius: 6px; }

/* ---------- bookings list ---------- */
.bk-row { width: 100%; padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.bk-ico {
  width: 46px; height: 46px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.3rem;
}
.bk-ico.flight { background: #e3ecf8; }
.bk-ico.hotel { background: #f3e8f8; }
.bk-ico.activity { background: #e8f5e9; }
.bk-info { flex: 1; min-width: 0; }
.bk-info .t { font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-info .s { font-size: .78rem; color: var(--ink-soft); }
.bk-right { text-align: right; flex: none; }
.status {
  font-size: .7rem; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
}
.status.confirmed { background: #dff3e6; color: var(--green-ok); }
.status.cancelled { background: #fbe4dd; color: var(--coral); }
.bk-right .ref { font-family: var(--font-display); font-size: .8rem; color: var(--ink-soft); margin-top: 4px; letter-spacing: .08em; }

.empty {
  text-align: center;
  padding: 60px 30px;
  color: var(--ink-soft);
}
.empty .em { font-size: 3rem; }
.empty p { margin: 10px 0 18px; }

/* ---------- auth & profile ---------- */
.auth-wrap { padding: 30px 22px; display: grid; gap: 14px; }
.auth-logo { display: grid; justify-items: center; gap: 8px; margin-bottom: 8px; }
.auth-logo img { width: 74px; height: 74px; border-radius: 20px; box-shadow: var(--shadow); }
.auth-logo .nm { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--teal-900); }
.form-err {
  color: var(--coral);
  background: #fbe4dd;
  font-size: .85rem;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  text-align: center;
}
.linkish {
  border: none; background: none;
  color: var(--teal-700); font-family: var(--font-body); font-size: .9rem;
  text-decoration: underline; cursor: pointer;
  padding: 6px;
}
.profile-card {
  margin: 14px 16px 0;
  background: linear-gradient(135deg, var(--teal-950), var(--teal-700));
  color: #f4f1e6;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: center;
}
.avatar {
  width: 56px; height: 56px; flex: none;
  border-radius: 50%;
  background: var(--gold); color: var(--teal-950);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
}
.lang-seg {
  display: flex; gap: 4px;
  background: rgba(8, 46, 47, .07);
  border-radius: 12px;
  padding: 4px;
}
.lang-seg button {
  flex: 1;
  border: none; border-radius: 9px;
  background: transparent;
  font-family: var(--font-display); font-size: .9rem; font-weight: 500;
  color: var(--ink-soft);
  padding: 9px;
  cursor: pointer;
}
.lang-seg button.active { background: var(--teal-900); color: var(--gold); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  background: rgba(255, 253, 246, .88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(8, 46, 47, .08);
  padding: 6px 10px calc(var(--sab) + 6px);
}
.tab {
  flex: 1; max-width: 120px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .68rem; font-weight: 600;
  padding: 5px 0 3px;
  border-radius: 14px;
  transition: color .15s;
}
.tab svg { width: 23px; height: 23px; fill: currentColor; }
.tab.active { color: var(--teal-700); }
.tab.active svg { fill: var(--gold-deep); }

/* ---------- misc ---------- */
.loading { display: grid; place-items: center; padding: 60px; color: var(--ink-soft); }
.spinner {
  width: 34px; height: 34px;
  border: 3.5px solid var(--teal-100);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--sab) + 14px);
  left: 50%; transform: translateX(-50%);
  background: var(--teal-950); color: var(--cream);
  font-size: .88rem;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 99;
  animation: page-in .25s;
  max-width: 88vw;
  text-align: center;
}

@media (min-width: 561px) {
  .hero, .pagehead { border-radius: 0 0 30px 30px; }
  body { background-attachment: fixed; }
}
