/* Animated "Deal Guide" mock-up (guide-demo.js). Self-contained: every class is gd- prefixed and the
   root resets the type styles it could inherit from the host page. Fixed 1120 x 680 stage, scaled by JS. */

.gd-root {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1120 / 680;
  overflow: hidden;
  background: #f3f3f3;
  color: #181818;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  text-indent: 0;
  white-space: normal;
  word-spacing: 0;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}
.gd-root *,
.gd-root *::before,
.gd-root *::after { box-sizing: border-box; }

.gd-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1120px;
  height: 680px;
  transform-origin: 0 0;
}
.gd-scene {
  position: absolute;
  inset: 0;
}

/* ---- record header strip ---- */
.gd-rec {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 70px;
  margin: 14px 16px 0;
  padding: 0 18px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fff;
}
.gd-rec-icon {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #0b5cab;
}
.gd-rec-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  height: 12px;
  border-radius: 2px 2px 3px 3px;
  background: #fff;
}
.gd-rec-icon::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  top: 9px;
  height: 7px;
  border: 2px solid #fff;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}
.gd-rec-main { min-width: 0; }
.gd-rec-kind {
  color: #5c5c5c;
  font-size: 12px;
}
.gd-rec-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}
.gd-rec-fields {
  display: flex;
  gap: 40px;
  margin-left: auto;
}
.gd-rec-field {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.gd-rec-label {
  color: #5c5c5c;
  font-size: 12px;
}
.gd-rec-value { font-size: 14px; }
.gd-rec-field:nth-child(1) .gd-rec-value,
.gd-rec-field:nth-child(3) .gd-rec-value { color: #0b5cab; }

/* ---- guide card ---- */
.gd-card {
  height: 568px;
  margin: 12px 16px 0;
  padding: 16px 20px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fff;
}
.gd-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gd-card-glyph {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #d8e6f5;
}
.gd-card-glyph::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 7px;
  width: 12px;
  height: 2px;
  background: #0b5cab;
  box-shadow: 0 4px 0 #0b5cab, 0 8px 0 #0b5cab;
}
.gd-card-title {
  font-size: 16px;
  font-weight: 700;
}

/* ---- stage path ---- */
.gd-path-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.gd-path {
  display: flex;
  flex: 1 1 auto;
  height: 32px;
  overflow: hidden;
  border-radius: 16px;
}
.gd-step {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  margin-left: -8px;
  padding: 0 12px 0 20px;
  background: #ecebea;
  color: #3e3e3c;
  font-size: 12.5px;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%, 13px 50%);
  transition: background-color .3s ease-out, color .3s ease-out;
}
.gd-step:first-child {
  margin-left: 0;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
}
.gd-step:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 13px 50%); }
.gd-step.gd-is-done {
  background: #cfe1f5;
  color: #0b3f77;
}
.gd-step.gd-is-current {
  background: #0b5cab;
  color: #fff;
  font-weight: 600;
}
.gd-step-tick {
  display: none;
  width: 5px;
  height: 9px;
  margin-top: -3px;
  border: solid #0b3f77;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.gd-step.gd-is-done .gd-step-tick { display: block; }

/* ---- buttons (divs, never focusable) ---- */
.gd-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #fff;
  color: #0b5cab;
  font-size: 13px;
  white-space: nowrap;
}
.gd-btn--brand {
  border-color: #0b5cab;
  background: #0b5cab;
  color: #fff;
}
.gd-btn.gd-is-pressed { animation: gd-press .22s ease-out; }
@keyframes gd-press {
  0%   { transform: scale(1); }
  40%  { transform: scale(.95); filter: brightness(.92); }
  100% { transform: scale(1); }
}

/* ---- views ---- */
.gd-body { margin-top: 18px; }
.gd-view { display: none; }
.gd-view.gd-is-active {
  display: block;
  animation: gd-fade .25s ease-out;
}
@keyframes gd-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- checklist ---- */
.gd-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px 24px;
}
.gd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 38px;
}
.gd-mark {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid #c4c4c4;
  border-radius: 50%;
  background: #fff;
  transition: background-color .2s ease-out, border-color .2s ease-out;
}
.gd-mark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg);
}
.gd-is-met > .gd-mark {
  border-color: #2e844a;
  background: #2e844a;
}
.gd-is-met > .gd-mark::after { opacity: 1; }
.gd-mark.gd-pop { animation: gd-pop .3s ease-out; }
@keyframes gd-pop {
  0%   { transform: scale(.6); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.gd-row-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gd-row-label { font-weight: 600; }
.gd-row-value {
  margin-left: 6px;
  color: #5c5c5c;
}
.gd-pencil {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
}
.gd-pencil-svg {
  width: 13px;
  height: 13px;
  fill: #747474;
}
.gd-pencil.gd-is-pressed { background: #e5eef8; }

/* row editor: spans the full grid width while open */
.gd-editor {
  display: none;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
}
.gd-row.gd-is-editing {
  grid-column: 1 / -1;
  min-height: 50px;
  margin: 4px -10px;
  padding: 0 10px;
  border-radius: 6px;
  background: #f3f7fc;
}
.gd-row.gd-is-editing .gd-editor {
  display: flex;
  animation: gd-fade .2s ease-out;
}
.gd-row.gd-is-editing .gd-row-value,
.gd-row.gd-is-editing .gd-pencil { display: none; }
.gd-row.gd-is-editing .gd-row-text { flex: none; }
.gd-editor .gd-input { flex: 0 1 300px; }

/* ---- inputs ---- */
.gd-input {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  background: #fff;
  font-size: 13.5px;
  white-space: nowrap;
  transition: border-color .15s ease-out, box-shadow .15s ease-out, background-color .3s ease-out;
}
.gd-input--focus {
  border-color: #0b5cab;
  box-shadow: 0 0 0 2px rgba(11, 92, 171, .22);
}
.gd-input--pills { padding: 0 6px; }
.gd-caret {
  width: 1px;
  height: 17px;
  margin-left: -5px;
  background: #181818;
  animation: gd-blink 1s steps(1) infinite;
}
@keyframes gd-blink {
  50% { opacity: 0; }
}
.gd-flash { animation: gd-flash .9s ease-out; }
@keyframes gd-flash {
  0%   { background-color: #d8e6f5; }
  100% { background-color: transparent; }
}
.gd-input.gd-flash { animation-name: gd-flash-input; }
@keyframes gd-flash-input {
  0%   { background-color: #d8e6f5; }
  100% { background-color: #fff; }
}

/* ---- booking form ---- */
.gd-actions { margin-top: 14px; }
.gd-book {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .3s ease-out, opacity .25s ease-out;
}
.gd-book.gd-is-open {
  max-height: 190px;
  opacity: 1;
}
.gd-book-inner {
  display: grid;
  grid-template-columns: 230px 150px minmax(0, 1fr);
  gap: 12px 16px;
  margin-top: 14px;
  padding: 14px 16px 16px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fafaf9;
}
.gd-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.gd-field-label {
  color: #444;
  font-size: 12px;
}
.gd-book-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 10px;
}
.gd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px 0 4px;
  border: 1px solid #c4c4c4;
  border-radius: 12px;
  background: #fff;
  font-size: 12.5px;
  animation: gd-pill .25s ease-out;
}
@keyframes gd-pill {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}
.gd-pill-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7fa9d6;
}
.gd-pill-x {
  color: #747474;
  font-size: 14px;
  line-height: 1;
}

/* ---- Solution Design: upload ---- */
.gd-help {
  margin-top: 8px;
  color: #5c5c5c;
  font-size: 12.5px;
}
.gd-upload {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 16px;
}
.gd-drop {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 300px;
  height: 112px;
  border: 1.5px dashed #b0b0b0;
  border-radius: 6px;
  color: #0b5cab;
  font-size: 13px;
  transition: background-color .2s ease-out, border-color .2s ease-out;
}
.gd-drop.gd-is-over {
  border-color: #0b5cab;
  background: #eef4fb;
}
.gd-drop-arrow {
  position: relative;
  width: 2px;
  height: 18px;
  background: #0b5cab;
}
.gd-drop-arrow::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0;
  width: 10px;
  height: 10px;
  border: solid #0b5cab;
  border-width: 2px 0 0 2px;
  transform: rotate(45deg);
}
.gd-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 440px;
}
.gd-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid #e2e2e2;
  border-radius: 4px;
  background: #fff;
  font-size: 13.5px;
}
.gd-file-glyph {
  flex: none;
  width: 16px;
  height: 20px;
  border: 1.5px solid #c23934;
  border-radius: 2px;
  background: linear-gradient(#c23934, #c23934) 3px 10px / 7px 1.5px no-repeat,
              linear-gradient(#c23934, #c23934) 3px 6px / 7px 1.5px no-repeat;
}
.gd-file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gd-file-tick {
  flex: none;
  width: 6px;
  height: 11px;
  margin: -3px 6px 0 0;
  border: solid #2e844a;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg);
  transition: opacity .2s ease-out;
}
.gd-file.gd-is-done .gd-file-tick { opacity: 1; }
.gd-file--new {
  opacity: 0;
  transform: translate(-40px, -54px) rotate(-3deg);
}
.gd-file--new.gd-is-in { animation: gd-drop .42s ease-out forwards; }
@keyframes gd-drop {
  from { opacity: 0; transform: translate(-40px, -54px) rotate(-3deg); box-shadow: 0 10px 22px rgba(0, 0, 0, .16); }
  to   { opacity: 1; transform: none; box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
}
.gd-prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  height: 3px;
  background: #e5e5e5;
}
.gd-file.gd-is-loading .gd-prog { display: block; }
.gd-prog-bar {
  display: block;
  width: 0;
  height: 100%;
  background: #0b5cab;
}
.gd-file.gd-is-loading .gd-prog-bar { animation: gd-load 1.15s ease-out forwards; }
@keyframes gd-load {
  to { width: 100%; }
}

/* ---- Contract: detail list ---- */
.gd-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e2e2;
}
.gd-detail-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.gd-detail-label {
  color: #5c5c5c;
  font-size: 12px;
}
.gd-detail-label--gap { margin-top: 14px; }
.gd-detail-value {
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 4px;
  margin-left: -4px;
  border-radius: 3px;
}
.gd-detail-value--file { color: #0b5cab; }
.gd-signer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

/* ---- toasts ---- */
.gd-toasts {
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  display: flex;
  justify-content: center;
}
.gd-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 400px;
  height: 46px;
  padding: 0 20px 0 18px;
  border-radius: 6px;
  background: #2e844a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  animation: gd-toast .28s ease-out;
}
@keyframes gd-toast {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: none; }
}
.gd-toast-tick {
  width: 7px;
  height: 13px;
  margin-top: -4px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---- cursor + click ring ---- */
.gd-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 24px;
  margin: -2px 0 0 -2px;
  transition: transform .5s cubic-bezier(.22, .61, .36, 1), opacity .3s ease-out;
}
.gd-cursor.gd-is-gone { opacity: 0; }
.gd-cursor-svg {
  display: block;
  width: 20px;
  height: 24px;
  fill: #111;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
}
.gd-ring {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 2px solid #0b5cab;
  border-radius: 50%;
  opacity: 0;
}
.gd-ring.gd-is-on { animation: gd-ring .42s ease-out; }
@keyframes gd-ring {
  from { opacity: .7; transform: scale(.3); }
  to   { opacity: 0; transform: scale(1.15); }
}

/* ---- veil: time-skips and the loop restart ---- */
.gd-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f3f3;
  opacity: 0;
  transition: opacity .3s ease-out;
}
.gd-veil.gd-is-on { opacity: 1; }
.gd-veil-dots {
  display: none;
  color: #8a8a8a;
  font-size: 44px;
  letter-spacing: 6px;
  line-height: 1;
}
.gd-veil.gd-has-dots .gd-veil-dots { display: block; }

/* ---- static frame (prefers-reduced-motion): no cursor, no motion ---- */
.gd-is-static .gd-cursor,
.gd-is-static .gd-ring,
.gd-is-static .gd-veil { display: none; }
.gd-is-static *,
.gd-is-static *::before,
.gd-is-static *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .gd-root *,
  .gd-root *::before,
  .gd-root *::after {
    animation: none !important;
    transition: none !important;
  }
  .gd-cursor,
  .gd-ring { display: none; }
}
