/* Waytrace Link Builder — front-end widget
   Light cream widget background with a slightly lighter "surface" fill for
   inputs + the results card, per the Waytrace homepage mockup. Override any
   --wtlb-* variable from theme CSS to retheme without editing this file. */

.wtlb-widget {
	--wtlb-bg: #fbf8f0;                /* whole widget background, both columns */
	--wtlb-ink: #211c17;               /* headings/body text + solid-fill buttons */
	--wtlb-muted: #8a8275;             /* secondary/muted text everywhere in the widget */
	--wtlb-input-bg: #fffdf8;          /* input fields AND the results card fill */
	--wtlb-input-border: #ece4d3;      /* border on the input/card surfaces */
	--wtlb-outer-border: #e4ddd0;      /* hairlines against the widget background */
	--wtlb-radius: 12px;
	--wtlb-dot-color: #e8e2d5;
	--wtlb-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	max-width: 1040px;
	margin: 2rem auto;
	color: var( --wtlb-ink );
}

.wtlb-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	border: 1px solid var( --wtlb-outer-border );
	border-radius: var( --wtlb-radius );
	overflow: hidden;
}

@media ( max-width: 782px ) {
	.wtlb-grid { grid-template-columns: 1fr; }
}

.wtlb-col { padding: 2.25rem 2.5rem; }

.wtlb-col-form { background: var( --wtlb-bg ); }

.wtlb-col-preview {
	background-color: var( --wtlb-bg );
	background-image: radial-gradient( circle, var( --wtlb-dot-color ) 1.4px, transparent 1.4px );
	background-size: 40px 40px;
	border-left: 1px solid var( --wtlb-outer-border );
	display: flex;
	align-items: center;
}

@media ( max-width: 782px ) {
	.wtlb-col-preview { border-left: none; border-top: 1px solid var( --wtlb-outer-border ); }
}

.wtlb-preview-panel { width: 100%; }

/* -------------------------------------------------------------------------
   Left column — form
   ------------------------------------------------------------------------- */

.wtlb-heading-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.5rem;
}

.wtlb-heading-icon {
	width: 26px;
	height: 26px;
	color: var( --wtlb-accent, #a9772f );
	flex-shrink: 0;
}

.wtlb-title {
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0;
	line-height: 1.2;
}

.wtlb-subtitle {
	font-family: inherit;
	font-size: 0.95rem;
	color: var( --wtlb-muted );
	margin: 0 0 1.75rem;
}

.wtlb-field { margin-bottom: 1rem !important; width: 100%; }

.wtlb-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1.25rem;
	width: 100%;
	margin-bottom: 1rem !important;
}

.wtlb-field-row .wtlb-field { margin-bottom: 0 !important; }

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

.wtlb-field label {
	display: block;
	font-family: var( --wtlb-mono );
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var( --wtlb-muted );
	margin-bottom: 0.5rem;
}

.wtlb-optional { text-transform: none; letter-spacing: normal; font-weight: 400; }

.wtlb-widget input.wtlb-input {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	padding: 0.7rem 0.85rem;
	font-family: inherit;
	font-size: 0.95rem;
	color: var( --wtlb-ink );
	border: 1px solid var( --wtlb-input-border );
	border-radius: 8px;
	background: var( --wtlb-input-bg );
}

.wtlb-input::placeholder { color: #b7ae9d; }

.wtlb-input:focus {
	outline: none;
	border-color: var( --wtlb-accent, #a9772f );
	box-shadow: 0 0 0 3px color-mix( in srgb, var( --wtlb-accent, #a9772f ) 18%, transparent );
}

.wtlb-widget p.wtlb-field-desc {
	font-family: inherit;
	font-size: 0.82rem;
	color: var( --wtlb-muted );
	margin: 0.3rem 0 0 !important;
}

.wtlb-hp-wrap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wtlb-error {
	font-family: inherit;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 8px;
	padding: 0.6rem 0.8rem;
	font-size: 0.85rem;
	margin-bottom: 1rem;
}

.wtlb-submit-btn {
	width: 100%;
	padding: 0.9rem 1rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: var( --wtlb-ink );
	border: 1px solid var( --wtlb-ink );
	border-radius: 8px;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.wtlb-submit-btn:hover { opacity: 0.88; }
.wtlb-submit-btn:disabled { opacity: 0.6; cursor: default; }

/* -------------------------------------------------------------------------
   Right column — preview
   ------------------------------------------------------------------------- */

.wtlb-eyebrow {
	font-family: var( --wtlb-mono );
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var( --wtlb-muted );
	margin: 0 0 0.6rem;
}

.wtlb-preview-heading {
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 1.5rem;
	max-width: 22ch;
}

.wtlb-preview-card {
	background: var( --wtlb-input-bg );
	border: 1px solid var( --wtlb-input-border );
	border-radius: var( --wtlb-radius );
	padding: 1.4rem 1.5rem;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 );
}

.wtlb-preview-url {
	font-family: var( --wtlb-mono );
	font-size: 0.88rem;
	line-height: 1.65;
	word-break: break-all;
	margin-bottom: 1.1rem;
	color: var( --wtlb-ink );
}

.wtlb-muted { color: var( --wtlb-muted ); }

.wtlb-preview-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding-top: 1rem;
	border-top: 1px solid var( --wtlb-input-border );
}

.wtlb-not-saved {
	font-family: var( --wtlb-mono );
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var( --wtlb-muted );
}

.wtlb-copy-btn {
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	padding: 0.45rem 1.1rem;
	border: 1px solid var( --wtlb-accent, #a9772f );
	color: var( --wtlb-accent, #a9772f );
	background: transparent;
	border-radius: 6px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.wtlb-copy-btn:hover:not(:disabled) {
	background: var( --wtlb-accent, #a9772f );
	color: #fff;
}

.wtlb-copy-btn:disabled { opacity: 0.4; cursor: default; }

.wtlb-upgrade-block {
	margin-top: 1.75rem;
}

.wtlb-upgrade-block p {
	font-family: inherit;
	font-size: 0.9rem;
	color: var( --wtlb-muted );
	margin: 0 0 0.9rem;
	max-width: 30ch;
}

.wtlb-upgrade-btn {
	display: inline-block;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	color: var( --wtlb-ink );
	background: var( --wtlb-input-bg );
	border: 1px solid var( --wtlb-ink );
	border-radius: 8px;
	padding: 0.7rem 1.4rem;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.wtlb-upgrade-btn:hover {
	background: var( --wtlb-ink );
	color: #fff;
	text-decoration: none;
}

.wtlb-hidden { display: none !important; }
