/* ============================================================
   क'Laa · Client Discovery Questionnaire
   Token system & Styles scoped to .kala-discovery
   ============================================================ */

.kala-discovery {
  --ivory:#F8F4EC;
  --sand:#EFE6D4;
  --sand-deep:#E5D9C2;
  --ink:#2A2419;
  --ink-soft:#6B6153;
  --ink-faint:#9C9280;
  --gold:#AC8A54;
  --gold-deep:#8C6F3E;
  --clay:#B4805B;
  --line:#E1D3B8;
  --white:#FFFDF9;
  --shadow-1: 0 1px 2px rgba(42,36,25,0.04), 0 8px 24px rgba(42,36,25,0.06);
  --shadow-2: 0 4px 10px rgba(42,36,25,0.06), 0 20px 48px rgba(42,36,25,0.10);
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 28px;
  --ease: cubic-bezier(.16,.84,.32,1);
  --dur-s: 320ms;
  --dur-m: 560ms;
  --dur-l: 900ms;
  --maxw: 1180px;
  
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

.kala-discovery input, 
.kala-discovery textarea, 
.kala-discovery select {
    font-family: inherit;
}

.kala-discovery ::selection {
    background: var(--gold);
    color: var(--white);
}

.kala-discovery h2, 
.kala-discovery h3, 
.kala-discovery h4 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.kala-discovery .eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kala-discovery .eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

.kala-discovery p {
  color: var(--ink-soft);
}

/* ============================================================
   Sticky progress
   ============================================================ */
#progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(248, 244, 236, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform var(--dur-m) var(--ease);
}

#progress-rail.show {
  transform: translateY(0);
}

.kala-discovery .rail-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.kala-discovery .rail-brand {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  letter-spacing: .03em;
  color: var(--ink);
  white-space: nowrap;
}

.kala-discovery .rail-track {
  flex: 1;
  height: 1px;
  background: var(--line);
  position: relative;
}

.kala-discovery .rail-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--gold);
  width: 0%;
  transition: width var(--dur-m) var(--ease);
}

.kala-discovery .rail-fill::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.kala-discovery .rail-step {
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: .08em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Form shell
   ============================================================ */
#journey-questionnaire {
  position: relative;
  background: var(--ivory);
  padding: 0 32px 140px;
}

.kala-discovery .qform-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 80px 0 40px;
  text-align: center;
}

.kala-discovery .qform-head h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin-top: 16px;
}

.kala-discovery .steps-wrap {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  min-height: 420px;
}

.kala-discovery .step {
  display: none;
  animation: stepIn var(--dur-m) var(--ease);
}

.kala-discovery .step.active {
  display: block;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.kala-discovery .step-head {
  margin-bottom: 36px;
  text-align: left;
}

.kala-discovery .step-head h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  margin-top: 14px;
  line-height: 1.25;
}

.kala-discovery .step-head p {
  margin-top: 10px;
  font-size: 14.5px;
}

.kala-discovery .field-group {
  margin-bottom: 26px;
  position: relative;
}

.kala-discovery .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media(max-width: 600px) {
  .kala-discovery .field-row { grid-template-columns: 1fr; }
}

.kala-discovery .field {
  position: relative;
}

.kala-discovery .field input[type=text],
.kala-discovery .field input[type=email],
.kala-discovery .field input[type=tel],
.kala-discovery .field input[type=url],
.kala-discovery .field input[type=number],
.kala-discovery .field textarea,
.kala-discovery .field select {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 16px 8px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color var(--dur-s) var(--ease), box-shadow var(--dur-s) var(--ease);
  appearance: none;
}

.kala-discovery .field select {
  padding: 20px 16px 8px;
}

.kala-discovery .field textarea {
  min-height: 110px;
  resize: vertical;
  padding-top: 22px;
}

.kala-discovery .field input:focus,
.kala-discovery .field textarea:focus,
.kala-discovery .field select:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(172, 138, 84, 0.14);
}

.kala-discovery .field label {
  position: absolute;
  left: 16px;
  top: 19px;
  font-size: 15px;
  color: var(--ink-faint);
  pointer-events: none;
  transition: all var(--dur-s) var(--ease);
  background: transparent;
}

.kala-discovery .field input:focus + label,
.kala-discovery .field input:not(:placeholder-shown) + label,
.kala-discovery .field textarea:focus + label,
.kala-discovery .field textarea:not(:placeholder-shown) + label,
.kala-discovery .field.has-value label,
.kala-discovery .field select:focus ~ label,
.kala-discovery .field select.has-value ~ label {
  top: 8px;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.kala-discovery .field-hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 6px;
}

/* Pill radio row (single choice, text) */
.kala-discovery .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kala-discovery .pill {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 13.5px;
  color: var(--ink-soft);
  transition: all var(--dur-s) var(--ease);
}

.kala-discovery .pill:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.kala-discovery .pill.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* Card grid (checkbox/radio cards) */
.kala-discovery .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.kala-discovery .card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: left;
  transition: all var(--dur-s) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.kala-discovery .card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-1);
  border-color: var(--gold);
}

.kala-discovery .card.selected {
  border-color: var(--gold);
  background: #FCF9F1;
  box-shadow: 0 0 0 1px var(--gold);
}

.kala-discovery .card .card-icon {
  width: 26px;
  height: 26px;
  color: var(--gold-deep);
}

.kala-discovery .card .card-icon svg {
  width: 100%;
  height: 100%;
}

.kala-discovery .card .card-label {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}

.kala-discovery .card .card-check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line);
  transition: all var(--dur-s) var(--ease);
}

.kala-discovery .card.selected .card-check {
  background: var(--gold);
  border-color: var(--gold);
}

.kala-discovery .card.selected .card-check::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--white);
}

/* Style swatch cards (design style — texture instead of photography) */
.kala-discovery .swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.kala-discovery .swatch-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
  transition: all var(--dur-s) var(--ease);
  text-align: left;
}

.kala-discovery .swatch-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}

.kala-discovery .swatch-card.selected {
  box-shadow: 0 0 0 2px var(--gold);
}

.kala-discovery .swatch-tex {
  height: 104px;
  position: relative;
}

.kala-discovery .swatch-meta {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kala-discovery .swatch-meta .name {
  font-family: 'Fraunces', serif;
  font-size: 15.5px;
}

.kala-discovery .swatch-meta .tick {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.kala-discovery .swatch-card.selected .tick {
  background: var(--gold);
  border-color: var(--gold);
}

/* Room accordion */
.kala-discovery .room-list {
  border-top: 1px solid var(--line);
}

.kala-discovery .room-item {
  border-bottom: 1px solid var(--line);
}

.kala-discovery .room-trigger {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.kala-discovery .room-trigger .name {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  color: var(--ink);
}

.kala-discovery .room-trigger .plus {
  width: 20px;
  height: 20px;
  position: relative;
  flex: none;
}

.kala-discovery .room-trigger .plus::before,
.kala-discovery .room-trigger .plus::after {
  content: '';
  position: absolute;
  background: var(--gold-deep);
  transition: transform var(--dur-s) var(--ease);
}

.kala-discovery .room-trigger .plus::before {
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  transform: translateY(-50%);
}

.kala-discovery .room-trigger .plus::after {
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  transform: translateX(-50%);
}

.kala-discovery .room-item.open .plus::after {
  transform: translateX(-50%) rotate(90deg);
  opacity: 0;
}

.kala-discovery .room-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-m) var(--ease);
}

.kala-discovery .room-item.open .room-body {
  max-height: 400px;
}

.kala-discovery .room-body-inner {
  padding: 0 4px 24px;
  display: grid;
  gap: 16px;
}

.kala-discovery .room-body-inner .field textarea {
  min-height: 70px;
}

/* Toggle row */
.kala-discovery .toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.kala-discovery .toggle-row .label {
  font-size: 14.5px;
  color: var(--ink);
}

.kala-discovery .switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: none;
}

.kala-discovery .switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.kala-discovery .switch .track {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  transition: background var(--dur-s) var(--ease);
}

.kala-discovery .switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-s) var(--ease);
}

.kala-discovery .switch input:checked + .track {
  background: var(--gold);
}

.kala-discovery .switch input:checked + .track .thumb {
  transform: translateX(20px);
}

.kala-discovery .switch input:checked ~ .thumb {
  transform: translateX(20px);
}

/* File dropzone */
.kala-discovery .dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 34px 20px;
  text-align: center;
  background: var(--white);
  transition: all var(--dur-s) var(--ease);
  cursor: pointer;
  position: relative;
}

.kala-discovery .dropzone:hover,
.kala-discovery .dropzone.drag {
  border-color: var(--gold);
  background: #FCF9F1;
}

.kala-discovery .dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.kala-discovery .dropzone .dz-label {
  font-size: 14px;
  color: var(--ink-soft);
}

.kala-discovery .dropzone .dz-sub {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 4px;
}

.kala-discovery .file-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kala-discovery .file-chip {
  font-size: 12px;
  background: var(--sand);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--ink-soft);
}

/* Nav controls */
.kala-discovery .step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.kala-discovery .step-nav .spacer {
  flex: 1;
}

.kala-discovery .step-count {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.kala-discovery .autosave-note {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: .03em;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.kala-discovery .autosave-note .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8CA57C;
}

/* Success */
#journey-thank-you {
  padding: 160px 32px 140px;
  text-align: center;
  background: var(--ivory);
}

.kala-discovery .success-mark {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  animation: markPop .6s var(--ease);
}

@keyframes markPop {
  from { transform: scale(.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.kala-discovery .success-mark svg {
  width: 26px;
  height: 26px;
  stroke: var(--gold-deep);
}

.kala-discovery #journey-thank-you h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  max-width: 600px;
  margin: 0 auto;
}

.kala-discovery #journey-thank-you p {
  max-width: 480px;
  margin: 18px auto 0;
  font-size: 15.5px;
}

.kala-discovery .success-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* Validation */
.kala-discovery .field.invalid input,
.kala-discovery .field.invalid textarea {
  border-color: #B4573F;
}

.kala-discovery .field-error {
  font-size: 11.5px;
  color: #B4573F;
  margin-top: 6px;
  display: none;
}

.kala-discovery .field.invalid .field-error {
  display: block;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--white);
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 600;
  transition: transform var(--dur-s) cubic-bezier(.16,.84,.32,1);
  box-shadow: 0 4px 10px rgba(42,36,25,0.06), 0 20px 48px rgba(42,36,25,0.10);
}

#toast.show {
  transform: translateX(-50%) translateY(0);
}

@media(max-width: 600px) {
  #journey-questionnaire { padding: 0 20px 100px; }
  .kala-discovery .rail-inner { padding: 12px 20px; }
}
