/* ===========================================================
   Tour Around TH — Partner Portal (login + dashboard)
   Reuses the brand palette from styles.css
   =========================================================== */
@import url("styles.css");

/* The hidden attribute must always win, even over .btn/.qb display rules. */
[hidden]{ display:none !important; }

/* ---------- Auth screen ---------- */
.auth{
  min-height:100vh;
  display:grid;
  grid-template-columns:1.1fr .9fr;
  background:var(--ivory);
}
.auth__aside{
  position:relative;
  color:#fff;
  padding:60px 56px;
  display:flex; flex-direction:column; justify-content:space-between;
  background:linear-gradient(160deg,var(--emerald-800),var(--emerald-900));
  overflow:hidden;
}
.auth__aside::before{
  content:""; position:absolute; inset:0;
  background:
    url("https://images.unsplash.com/photo-1528181304800-259b08848526?auto=format&fit=crop&w=1400&q=80") center/cover no-repeat;
  opacity:.18;
}
.auth__aside > *{ position:relative; z-index:2; }
.auth__asideTitle{
  font-family:var(--serif); font-weight:600;
  font-size:clamp(2rem,3vw,2.8rem); line-height:1.1; margin:24px 0 14px;
}
html[lang="th"] .auth__asideTitle{ font-family:var(--sans); font-weight:700; }
.auth__asideText{ color:rgba(255,255,255,.82); max-width:420px; }
.auth__points{ list-style:none; margin-top:30px; display:flex; flex-direction:column; gap:14px; }
.auth__points li{ display:flex; gap:12px; align-items:flex-start; color:rgba(255,255,255,.9); font-size:.96rem; }
.auth__points li::before{ content:"◇"; color:var(--gold-soft); }

.auth__main{ display:flex; align-items:center; justify-content:center; padding:48px 24px; }
.auth__card{ width:100%; max-width:400px; }
.auth__brand{ display:flex; align-items:center; gap:12px; margin-bottom:34px; }
.auth__eyebrow{ display:inline-block; font-size:.74rem; letter-spacing:.2em; text-transform:uppercase; font-weight:600; color:var(--gold); margin-bottom:10px; }
.auth__title{ font-family:var(--serif); font-weight:600; font-size:2rem; color:var(--emerald-900); margin-bottom:8px; }
html[lang="th"] .auth__title{ font-family:var(--sans); font-weight:700; }
.auth__sub{ color:var(--muted); font-size:.95rem; margin-bottom:28px; }

.auth__alert{
  display:none; margin-bottom:18px; padding:12px 14px; border-radius:11px;
  font-size:.88rem; border:1px solid;
}
.auth__alert.is-error{ display:block; background:#fdf0ef; border-color:#e7b7b2; color:#9a2b1f; }
.auth__alert.is-info{ display:block; background:#eef6f2; border-color:#bcdccd; color:#1c5e44; }

.auth__foot{ margin-top:24px; font-size:.84rem; color:var(--muted); text-align:center; }
.auth__foot a{ color:var(--emerald-700); font-weight:600; }
.linkbtn{ background:none; border:0; color:var(--emerald-700); font-weight:600; cursor:pointer; font-size:inherit; font-family:inherit; padding:0; }
.linkbtn:hover{ color:var(--gold); }

/* ---------- Dashboard ---------- */
.appbar{
  position:sticky; top:0; z-index:40;
  background:rgba(247,244,236,.9); backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
}
.appbar__inner{ display:flex; align-items:center; justify-content:space-between; height:66px; }
.appbar__right{ display:flex; align-items:center; gap:16px; }
.appbar__user{ font-size:.86rem; color:var(--muted); }
.appbar__user b{ color:var(--emerald-900); font-weight:600; }

.dash{ padding:38px 0 60px; }
.dash__head{ margin-bottom:26px; }
.dash__title{ font-family:var(--serif); font-weight:600; font-size:clamp(1.7rem,3vw,2.4rem); color:var(--emerald-900); }
html[lang="th"] .dash__title{ font-family:var(--sans); font-weight:700; }
.dash__sub{ color:var(--muted); margin-top:6px; }

.dash__grid{ display:grid; grid-template-columns:300px 1fr; gap:24px; align-items:start; }

/* Brief form (left) */
.brief{ background:var(--white); border:1px solid var(--line); border-radius:18px; padding:24px; box-shadow:var(--shadow); }
.brief h3{ font-family:var(--serif); font-size:1.25rem; color:var(--emerald-900); margin-bottom:16px; }
html[lang="th"] .brief h3{ font-family:var(--sans); font-weight:700; }

/* Chat (right) */
.chat{
  background:var(--white); border:1px solid var(--line); border-radius:18px;
  box-shadow:var(--shadow); display:flex; flex-direction:column; height:72vh; min-height:520px; overflow:hidden;
}
.chat__head{ padding:18px 22px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:12px; }
.chat__dot{ width:9px; height:9px; border-radius:50%; background:#3fae7a; box-shadow:0 0 0 4px rgba(63,174,122,.18); }
.chat__head h3{ font-family:var(--serif); font-size:1.2rem; color:var(--emerald-900); }
.chat__head span{ font-size:.78rem; color:var(--muted); }
html[lang="th"] .chat__head h3{ font-family:var(--sans); font-weight:700; }

.chat__log{ flex:1; overflow-y:auto; padding:22px; display:flex; flex-direction:column; gap:16px; }
.msg{ max-width:80%; padding:13px 16px; border-radius:14px; font-size:.95rem; line-height:1.55; white-space:pre-wrap; }
.msg--bot{ align-self:flex-start; background:var(--ivory-2); color:var(--ink); border-bottom-left-radius:4px; }
.msg--user{ align-self:flex-end; background:linear-gradient(135deg,var(--emerald-700),var(--emerald-900)); color:#fff; border-bottom-right-radius:4px; }
.msg--bot b{ color:var(--emerald-900); }
.msg__typing{ display:inline-flex; gap:4px; }
.msg__typing span{ width:7px; height:7px; border-radius:50%; background:var(--muted); opacity:.5; animation:blink 1.2s infinite; }
.msg__typing span:nth-child(2){ animation-delay:.2s; }
.msg__typing span:nth-child(3){ animation-delay:.4s; }
@keyframes blink{ 0%,60%,100%{ opacity:.25; } 30%{ opacity:.9; } }

.chat__form{ border-top:1px solid var(--line); padding:14px; display:flex; gap:10px; }
.chat__form textarea{
  flex:1; resize:none; border:1px solid var(--line); border-radius:12px;
  padding:12px 14px; font-family:inherit; font-size:.95rem; background:var(--ivory);
  max-height:120px;
}
.chat__form textarea:focus{ outline:0; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,162,75,.18); background:#fff; }

@media (max-width:900px){
  .auth{ grid-template-columns:1fr; }
  .auth__aside{ display:none; }
  .dash__grid{ grid-template-columns:1fr; }
  .chat{ height:68vh; }
}

/* ---------- Quotation builder ---------- */
.dash__sub{ color:var(--muted); margin-top:6px; max-width:60ch; }
.qb{ max-width:920px; }
.qb__settings{
  display:flex; gap:18px; align-items:flex-end; flex-wrap:wrap;
  background:var(--white); border:1px solid var(--line); border-radius:16px;
  padding:18px 20px; box-shadow:var(--shadow); margin-bottom:20px;
}
.qb__settings .field{ margin:0; }
.qb__settings .field input{ width:120px; }
.qb__settings .field input[type="date"]{ width:170px; }
.qb__toggle{ display:flex; align-items:center; gap:9px; font-size:.9rem; color:var(--emerald-900); font-weight:500; padding-bottom:10px; cursor:pointer; }
.qb__toggle input{ width:18px; height:18px; accent-color:var(--gold); }

.qb__stops{ display:flex; flex-direction:column; gap:16px; }
.stop{ background:var(--white); border:1px solid var(--line); border-radius:16px; padding:18px 20px; box-shadow:var(--shadow); }
.stop__head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.stop__badge{ font-family:var(--serif); font-weight:600; font-size:1.15rem; color:var(--emerald-900); }
.stop__remove{ font-size:.84rem; }
.stop__row{ display:grid; grid-template-columns:1.4fr .7fr 1.4fr; gap:14px; }
.stop__row .field{ margin:0; }
.stop__row select, .stop__row input{
  width:100%; border:1px solid var(--line); border-radius:10px; padding:.6em .7em; font:inherit; background:#fff; color:var(--ink);
}
.stop__row select:focus, .stop__row input:focus{ outline:0; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,162,75,.18); }

.stop__rooms{ margin-top:16px; }
.stop__roomlist{ display:flex; flex-direction:column; gap:8px; margin-bottom:8px; }
.roomrow{ display:flex; align-items:center; gap:8px; }
.roomrow__type{ flex:1; border:1px solid var(--line); border-radius:10px; padding:.55em .7em; font:inherit; background:#fff; color:var(--ink); }
.roomrow__qty{ width:72px; border:1px solid var(--line); border-radius:10px; padding:.55em .6em; font:inherit; text-align:center; }
.roomrow__type:focus, .roomrow__qty:focus{ outline:0; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,162,75,.18); }
.roomrow__del{ color:#b23a3a; font-size:1rem; }
.stop__addroom{ background:transparent; border:1.5px dashed var(--line); color:var(--emerald-800); font:inherit; font-weight:600; border-radius:10px; padding:.5em 1em; cursor:pointer; font-size:.85rem; }
.stop__addroom:hover{ border-color:var(--gold); color:var(--emerald-900); }

.stop__guide{ margin-top:16px; }
.guiderow{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.guiderow .stop__guidesel{ flex:1; min-width:200px; border:1px solid var(--line); border-radius:10px; padding:.55em .7em; font:inherit; background:#fff; color:var(--ink); }
.guiderow .stop__guidesel:focus{ outline:0; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,162,75,.18); }
.guiderow__d{ font-size:.84rem; color:var(--emerald-900); display:flex; align-items:center; gap:6px; }
.guiderow__d input{ width:64px; border:1px solid var(--line); border-radius:9px; padding:.45em .5em; font:inherit; text-align:center; }
.guiderow__d input:focus{ outline:0; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,162,75,.18); }

.stop__pick{ display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:16px; }
.stop__picklabel{ display:block; font-size:.78rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--emerald-800); margin-bottom:8px; }
.checklist{ display:flex; flex-direction:column; gap:7px; }
.checklist__item{ display:flex; align-items:center; gap:9px; font-size:.9rem; color:var(--ink); cursor:pointer; }
.checklist__item input{ width:17px; height:17px; accent-color:var(--gold); }
.checklist__empty{ font-size:.85rem; color:var(--muted); }

.qb__add{
  align-self:flex-start; margin-top:16px; background:transparent;
  border:1.5px dashed var(--line); color:var(--emerald-800); font:inherit; font-weight:600;
  border-radius:12px; padding:.7em 1.2em; cursor:pointer;
}
.qb__add:hover{ border-color:var(--gold); color:var(--emerald-900); }

.qb__actions{ display:flex; gap:12px; flex-wrap:wrap; margin-top:22px; }

.qb__msg{ margin-top:16px; border-radius:12px; padding:12px 16px; font-size:.9rem; border:1px solid var(--line); }
.qb__msg.is-error{ background:rgba(178,58,58,.08); color:#8f2f2f; border-color:rgba(178,58,58,.25); }
.qb__msg.is-info{ background:rgba(201,162,75,.12); color:var(--emerald-800); }
.qb__msg.is-success{ background:rgba(10,58,44,.07); color:var(--emerald-900); border-color:rgba(10,58,44,.2); }

/* Result summary */
.qb__result{ margin-top:24px; background:var(--white); border:1px solid var(--line); border-radius:16px; padding:24px; box-shadow:var(--shadow); }
.sum__title{ font-family:var(--serif); font-weight:600; font-size:1.4rem; color:var(--emerald-900); }
.sum__meta{ color:var(--muted); font-size:.86rem; margin:4px 0 18px; }
.sum__stop{ border-left:3px solid var(--gold); padding:4px 0 4px 14px; margin-bottom:14px; }
.sum__city{ font-weight:700; color:var(--emerald-900); }
.sum__hotel{ font-size:.9rem; color:var(--ink); margin-top:2px; }
.sum__extra{ font-size:.84rem; color:var(--muted); margin-top:3px; }
.sum__dates{ font-size:.82rem; color:var(--muted); margin-top:2px; }
.sum__season{ display:inline-block; font-size:.66rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:#7a5c15; background:rgba(201,162,75,.18); padding:1px 7px; border-radius:999px; margin-left:6px; vertical-align:middle; }
.sum__total{
  display:flex; align-items:center; justify-content:space-between;
  border-top:1px solid var(--line); margin-top:10px; padding-top:18px;
}
.sum__total span{ font-size:.9rem; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.sum__total strong{ font-family:var(--serif); font-weight:700; font-size:2rem; color:var(--emerald-900); }
.sum__note{ font-size:.82rem; color:var(--muted); margin-top:12px; }

@media (max-width:640px){
  .stop__row{ grid-template-columns:1fr; }
  .stop__pick{ grid-template-columns:1fr; }
}
