/* ==========================================================================
   Plan My Trip (13 Basics · 13b Preferences · 13c Contact · 13d Review · 13e Sent)
   Template: page-templates/plan-my-trip.php · parts: template-parts/plan/
   Everything is scoped under .plan-page (plus the toast under .tpl-plan-my-trip).
   `.is-js` is added inline as the page renders; without it every step shows and
   JS-only controls are hidden.
   Measurements follow the Figma frames: desktop = 13b–13e (step 1 has a few
   overrides for frame 13, marked "frame 13"), mobile = the 390 frames.
   ========================================================================== */

.plan-page { padding: 65px 0 82px; }
.plan-page:not(.is-js) .plan-js-only { display: none !important; }

/* --- Heading -------------------------------------------------------------- */
.plan-eyebrow { font-size: 11px; line-height: 16.5px; font-weight: 700; color: var(--c-primary); }
.plan-title { margin-top: 19px; font-size: 46px; line-height: 54px; font-weight: 400; color: var(--c-navy); }
.plan-title strong { font-weight: 700; }
.plan-title span { display: block; }
.plan-lead { margin-top: 13.5px; font-size: 16px; line-height: 24px; color: var(--c-muted); }

/* --- Step indicator ------------------------------------------------------- */
.plan-progress {
	margin-top: 40px; height: 66px; padding: 0 7px 0 16px;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	background: var(--c-white); border: 1px solid #e2e8f0; border-radius: var(--r-card);
}
.plan-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.plan-steps-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--c-muted); }
.plan-steps-item + .plan-steps-item::before { content: ""; width: 28px; height: 2px; margin-right: 6px; background: var(--c-line); }
.plan-steps-dot {
	width: 24px; height: 24px; flex: none; border-radius: 50%;
	display: grid; place-content: center;
	border: 1px solid var(--c-line); background: var(--c-white); color: var(--c-muted);
	font-size: 11px; line-height: 14px; font-weight: 700;
}
.plan-steps-check { display: none; }
.plan-steps-item.is-current,
.plan-steps-item.is-done { color: var(--c-ink); font-weight: 600; }
.plan-steps-item.is-current::before,
.plan-steps-item.is-done::before { background: var(--c-primary); }
.plan-steps-item.is-current .plan-steps-dot,
.plan-steps-item.is-done .plan-steps-dot { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-white); }
.plan-steps-item.is-done .plan-steps-num { display: none; }
.plan-steps-item.is-done .plan-steps-check { display: block; }
.plan-progress-count {
	flex: none; width: 86px; height: 24px; padding: 0 11px;
	border: 1px solid #dbe8f7; border-radius: var(--r-pill); background: var(--c-tint-2);
	font-size: 12px; line-height: 22px; font-weight: 700; color: var(--c-navy); white-space: nowrap;
}
.plan-page:not(.is-js) .plan-progress-count { visibility: hidden; }

.plan-alert { margin-top: 24px; }
.plan-alert + .plan-layout { margin-top: 24px; }

/* --- Layout ----------------------------------------------------------------- */
.plan-layout { margin-top: 40px; display: grid; grid-template-columns: minmax(0, 1fr) 438px; column-gap: 31px; align-items: start; }
.plan-aside { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* --- Cards and steps --------------------------------------------------------- */
.plan-card { background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-card); padding: 28px; }
.plan-page.is-js .plan-step:not(.is-current) { display: none; }
.plan-page:not(.is-js) .plan-step + .plan-step { margin-top: 16px; }
.plan-card-title { font-size: 22px; line-height: 27.5px; font-weight: 400; color: var(--c-ink); }
.plan-card-title strong { font-weight: 700; }
.plan-card-title:focus { outline: none; }
.plan-card-lead { margin-top: 16.5px; font-size: 14px; line-height: 21px; color: var(--c-muted); }
.plan-card-foot { margin-top: 16px; font-size: 12.5px; line-height: 19px; color: var(--c-muted); }

/* --- Fields --------------------------------------------------------------- */
.plan-fields { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.plan-card-lead + .plan-fields { margin-top: 16px; }
.plan-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.plan-page .field { gap: 6px; }
.plan-page .field-label { font-size: 13px; font-weight: 600; line-height: 18px; color: var(--c-ink); }
.plan-page .field-label .req { margin-left: 2px; color: var(--c-error); }
.plan-page .field-label .opt { font-size: 12px; }
.plan-page .field-hint { margin-top: 10px; font-size: 12.5px; line-height: 19px; color: var(--c-muted); }
.plan-page .field-error { line-height: 19px; }

.plan-form :where(.input, .select, .textarea) {
	min-height: 0; height: 50px; padding: 0 14px;
	border-color: #e2e8f0; border-radius: var(--r-lg);
	font-size: 15px; line-height: 22px; color: var(--c-ink);
}
.plan-form :where(.input, .textarea)::placeholder { color: var(--c-faint); }
.plan-form .textarea { height: 120px; padding: 13px 14px; }
.plan-form .select,
.plan-form .select.is-placeholder {
	padding-right: 44px; color: var(--c-ink);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7a99' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-size: 24px 24px; background-position: right 10px center;
}
.plan-input-icon { position: relative; }
.plan-input-icon > .icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: #6b7a99; pointer-events: none; }
.plan-input-icon > .input { padding-left: 39px; }
/* The browser's datalist arrow would cover the right edge of the field. */
.plan-input-icon > .input::-webkit-calendar-picker-indicator { opacity: 0; }

/* Chips (checkbox groups) */
.plan-chips { margin: 0; padding: 0; border: 0; min-width: 0; }
.plan-chips legend { padding: 0; }
.plan-chips .chips { margin-top: 8px; gap: 8px; }
.plan-chip { position: relative; min-height: 36px; padding: 8px 16px; cursor: pointer; user-select: none; color: var(--c-body); }
.plan-chip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.plan-chip:has(input:checked), .plan-chip.is-active { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-white); }
.plan-chip:has(input:focus-visible) { box-shadow: var(--focus); }

/* Travel dates / Travellers: a field-like button with a small panel */
.plan-pop-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.plan-pop { position: relative; }
.plan-pop-trigger { display: flex; align-items: center; width: 100%; text-align: left; cursor: pointer; background: var(--c-white); }
.plan-pop-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-pop-trigger.is-placeholder { color: var(--c-faint); }
.plan-pop.is-open .plan-pop-trigger { border-color: var(--c-primary); box-shadow: var(--focus); }
.plan-pop-field.has-error .plan-pop-trigger { border-color: var(--c-error); }
.plan-pop-panel {
	display: flex; flex-direction: column; gap: 16px;
	padding: 20px; background: var(--c-white);
	border: 1px solid var(--c-line); border-radius: var(--r-card);
}
.plan-page.is-js .plan-pop-panel {
	display: none; position: absolute; z-index: 30; top: calc(100% + 8px); left: 0;
	width: 100%; min-width: 300px; box-shadow: var(--shadow-lg);
}
.plan-page.is-js .plan-pop.is-open .plan-pop-panel { display: flex; }
.plan-pop-title { font-size: 16px; line-height: 24px; font-weight: 700; color: var(--c-ink); }
.plan-pop-panel .stepper + .stepper { padding-top: 16px; border-top: 1px solid var(--c-line-soft); }
.plan-pop-done { width: 100%; min-height: 48px; padding: 0 20px; border: 0; }
.plan-date-field { display: flex; flex-direction: column; gap: 6px; }
.plan-date-field.has-error .input { border-color: var(--c-error); }
.plan-date-field.has-error .field-error { display: block; }

/* Traveller counts: plain number fields without JS, − n + with JS */
.plan-pop-panel .stepper { gap: 12px; }
.plan-count-input {
	width: 64px; min-height: 40px; padding: 6px 8px;
	border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-white);
	font-size: 16px; line-height: 24px; font-weight: 700; color: var(--c-ink); text-align: center;
}
.plan-page.is-js .plan-count-input {
	width: 34px; min-height: 0; padding: 2px 0; border-color: transparent; border-radius: var(--r-xs);
	-moz-appearance: textfield; appearance: textfield;
}
.plan-page.is-js .plan-count-input::-webkit-outer-spin-button,
.plan-page.is-js .plan-count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.plan-count-input:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--focus); }

/* Actions row: note on the left, Back + Continue on the right */
.plan-actions { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.plan-actions-note { flex: 1; min-width: 0; font-size: 12.5px; line-height: 19px; color: var(--c-muted); }
.plan-page .plan-btn-back { min-height: 0; height: 52px; padding: 0 28px; border-color: var(--c-line); }
.plan-page .plan-btn-next { min-height: 0; height: 50px; padding: 0 28px; border: 0; }

/* --- Review (13d) and sent (13e) summary ------------------------------------------ */
.plan-review { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.plan-review-box { padding: 16px; border: 1px solid var(--c-line); border-radius: var(--r-lg); }
.plan-review-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-review-title { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--c-ink); }
.plan-edit { padding: 0 2px; margin: 0 -2px; border-radius: var(--r-xs); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--c-primary); }
.plan-edit:hover { color: var(--c-primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.plan-review-rows { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.plan-review-row { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; line-height: 20px; }
.plan-review-row dt { flex: none; color: var(--c-body); }
.plan-review-row dd { min-width: 0; font-weight: 600; color: var(--c-ink); text-align: right; overflow-wrap: anywhere; white-space: pre-line; }

/* --- Side column -------------------------------------------------------------------- */
.plan-draft { padding: 27px 26px 25px 24px; border-color: #e2e8f0; }
.plan-draft-eyebrow { font-size: 11px; line-height: 16.5px; font-weight: 700; color: var(--c-muted); }
.plan-draft-title { margin-top: 14.5px; font-size: 22px; line-height: 33px; font-weight: 700; color: var(--c-navy); overflow-wrap: anywhere; }
.plan-draft-rows { margin-top: 14px; display: flex; flex-direction: column; gap: 10.75px; }
.plan-draft-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13.5px; line-height: 20.25px; }
.plan-draft-row dt { flex: none; color: var(--c-muted); }
.plan-draft-row dd { min-width: 0; font-weight: 700; color: var(--c-navy); text-align: right; overflow-wrap: anywhere; }
.plan-save {
	margin-top: 15.75px; display: flex; width: max-content; align-items: center; gap: 9px;
	font-size: 13.5px; line-height: 20.25px; font-weight: 700; color: var(--c-primary);
}
.plan-save:hover { color: var(--c-primary-hover); text-decoration: underline; text-underline-offset: 3px; }

.plan-next { padding: 28px 26px 27px 24px; background: var(--c-tint-2); border-color: #d7e6f7; }
.plan-next-title { font-size: 18px; line-height: 27px; font-weight: 700; color: var(--c-navy); }
.plan-next-list { margin-top: 15px; display: flex; flex-direction: column; gap: 15.75px; }
.plan-next-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; line-height: 20.25px; color: var(--c-body); }
.plan-next-num {
	width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-content: center;
	background: var(--c-primary); color: var(--c-white); font-size: 11.5px; line-height: 1; font-weight: 700;
}
.plan-next-note {
	margin-top: 13.75px; padding: 15px 15px 14px; text-align: center;
	background: #ecfdf5; border: 1px solid #d1fae5; border-radius: var(--r-field);
	font-size: 14px; line-height: 21px; font-weight: 700; color: var(--c-success);
}

/* --- Trust points ------------------------------------------------------------------- */
.plan-trust { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 32px; }
.plan-trust li { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; line-height: 21px; color: var(--c-body); }
.plan-trust .icon { color: #10b981; }

/* --- Toast "Draft saved" (overlay render), on this page only ------------------------- */
.tpl-plan-my-trip .toast { align-items: center; gap: 14px; padding: 20px; border-color: var(--c-line); box-shadow: 0 12px 32px rgba(15, 27, 45, .12); }
.tpl-plan-my-trip .toast-icon { color: #16a34a; }
.tpl-plan-my-trip .toast-icon svg { width: 22px; height: 22px; }
.tpl-plan-my-trip .toast-title { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--c-ink); }
.tpl-plan-my-trip .toast-text { margin-top: 2px; font-size: 14px; line-height: 21px; color: var(--c-body); }
.tpl-plan-my-trip .toast-close { display: none; }

/* --- Desktop: frame 13 (step 1) uses its own sizes ---------------------------------- */
@media (min-width: 768px) {
	.plan-progress.is-first .plan-steps-item { gap: 8px; }
	.plan-progress.is-first .plan-steps-item::before { margin-right: 4px; background: #e2e8f0; }
	.plan-progress.is-first .plan-steps-item.is-current { font-weight: 700; line-height: 19.5px; color: var(--c-navy); }
	.plan-progress.is-first .plan-steps-item.is-todo { font-weight: 400; line-height: 19.5px; }
	.plan-progress.is-first .plan-steps-dot { font-size: 11.5px; }
	.plan-progress.is-first .is-todo .plan-steps-dot { background: #e2e8f0; border-color: #e2e8f0; }

	#plan-step-1 { padding-bottom: 31px; }
	#plan-step-1 .plan-card-title { margin-top: 5px; font-size: 24px; line-height: 36px; color: var(--c-navy); }
	#plan-step-1 .plan-fields { margin-top: 20px; gap: 22px; }
	#plan-step-1 .plan-row { column-gap: 21px; }
	#plan-step-1 .field,
	#plan-step-1 .plan-pop-field { gap: 6.5px; }
	#plan-step-1 .field-label { font-weight: 700; line-height: 19.5px; color: var(--c-body); }
	#plan-step-1 .plan-pop-panel .field-label { font-weight: 600; line-height: 18px; color: var(--c-ink); }
	#plan-step-1 :where(.input, .select) { height: 52px; line-height: 22.5px; }
	#plan-step-1 .plan-chips .chips { margin-top: 8.5px; }
	#plan-step-1 .plan-chip { min-height: 38px; padding: 9px 16px; }
	#plan-step-1 .plan-actions { margin-top: 22px; }
	#plan-step-1 .plan-actions-note { font-size: 13px; line-height: 19.5px; }
	#plan-step-1 .plan-btn-next { height: 52px; padding: 0 30px; }
}

/* --- Responsive --------------------------------------------------------------------- */
@media (min-width: 1200px) {
	/* The four points sit at the design's fixed positions (x 372 / 562 / 786 / 944). */
	.plan-trust { display: grid; grid-template-columns: 190px 224px 158px max-content; justify-content: start; padding-left: 252px; gap: 0; }
}

@media (max-width: 1199px) {
	.plan-layout { grid-template-columns: minmax(0, 1fr) 380px; column-gap: 24px; }
}

@media (max-width: 1023px) {
	.plan-layout { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
	.plan-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
	.plan-title { font-size: 38px; line-height: 46px; }
}

@media (max-width: 767px) {
	.plan-page { padding: 30px 0 56px; }
	.plan-eyebrow { line-height: 16px; letter-spacing: .6px; }
	.plan-title { margin-top: 12px; font-size: 34px; line-height: 42.5px; color: var(--c-ink); }
	.plan-title span { display: inline; }
	.plan-lead { margin-top: 12px; line-height: 26px; color: var(--c-body); }

	.plan-progress { margin-top: 24px; height: auto; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0; background: none; border: 0; border-radius: 0; }
	.plan-steps { gap: 8px 12px; }
	.plan-progress.is-first .plan-steps { column-gap: 14px; }
	.plan-steps-item + .plan-steps-item::before { display: none; }
	.plan-progress-count { width: auto; height: auto; padding: 0; border: 0; border-radius: 0; background: none; line-height: 16px; color: var(--c-primary); }

	.plan-alert { margin-top: 16px; }
	.plan-layout,
	.plan-alert + .plan-layout { margin-top: 16px; row-gap: 16px; }
	.plan-aside { display: flex; align-items: stretch; gap: 16px; }

	.plan-card { padding: 20px; }
	.plan-row { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
	.plan-input-icon > .icon { display: none; }
	.plan-input-icon > .input { padding-left: 14px; }
	.plan-form .select,
	.plan-form .select.is-placeholder { padding-right: 14px; background-image: none; }
	.plan-pop-trigger.is-placeholder { color: var(--c-ink); }
	.plan-chip:has(input:checked), .plan-chip.is-active { min-height: 34px; border-width: 0; }
	.plan-page.is-js .plan-pop-panel { position: static; margin-top: 8px; min-width: 0; box-shadow: none; }

	.plan-actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
	.plan-actions .btn { width: 100%; }
	#plan-step-1 .plan-actions { row-gap: 16px; }

	.plan-draft { padding: 20px; border-color: var(--c-line); }
	.plan-draft-eyebrow { line-height: 16px; letter-spacing: .6px; color: var(--c-primary); }
	.plan-draft-title { margin-top: 10px; font-size: 20px; line-height: 26px; font-weight: 600; color: var(--c-ink); }
	.plan-draft-rows { margin-top: 10px; gap: 10px; }
	.plan-draft-row { font-size: 14px; line-height: 20px; }
	.plan-draft-row dt { color: var(--c-body); }
	.plan-draft-row dd { font-weight: 600; color: var(--c-ink); }
	.plan-save {
		width: 100%; height: 52px; margin-top: 10px; justify-content: center;
		border: 1px solid var(--c-line); border-radius: var(--r-btn); background: var(--c-white);
		font-size: 15px; line-height: 22px; font-weight: 600;
	}
	.plan-save:hover { background: var(--c-tint); border-color: var(--c-primary); text-decoration: none; }
	.plan-save .icon { display: none; }

	.plan-next { padding: 20px; background: var(--c-tint); border-color: var(--c-line); }
	.plan-next-title { line-height: 24px; font-weight: 600; color: var(--c-ink); }
	.plan-next-list { margin-top: 14px; gap: 16px; }
	.plan-next-list li { min-height: 40px; align-items: flex-start; gap: 12px; font-size: 14.5px; line-height: 20px; font-weight: 600; color: var(--c-ink); }
	.plan-next-num { width: 28px; height: 28px; font-size: 12px; }
	.plan-next-note { margin-top: 14px; padding: 0; border: 0; background: none; text-align: left; line-height: 20px; font-weight: 600; color: var(--c-success-dark); }

	.plan-trust { margin-top: 16px; justify-content: flex-start; gap: 8px; }
	.plan-trust li { padding: 4px 10px; border-radius: var(--r-pill); background: var(--c-tint); font-size: 11px; line-height: 16px; font-weight: 700; color: var(--c-primary); }
	.plan-trust .icon { display: none; }

	.tpl-plan-my-trip .toast-region { align-items: center; }
	.tpl-plan-my-trip .toast { width: 340px; }
}
