/*
 * Visual language matches the MarketDesign theme (xbaptiste.org):
 * monotone black/white, Noto Sans JP body text, generous whitespace.
 * Falls back gracefully if the theme fonts aren't loaded.
 *
 * No page-level heading is rendered by this plugin -- the host page
 * supplies its own heading above the shortcode.
 */

.tls {
	max-width: 640px;
	margin: 0 auto;
	padding: 80px 40px;
	color: var(--color-text, #1a1a1a);
}

/* ---------- Form ---------- */

.tls-form {
	font-family: 'Noto Sans JP', sans-serif;
	font-weight: 300;
}

.tls-field-label {
	display: block;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #666;
	margin: 0 0 8px;
}

/* Wraps the label + segmented control as one unit, so the label's left
   edge always lines up with the (centered) button group's left edge. */
.tls-segmented-group {
	width: fit-content;
	margin: 0 auto 28px;
}

/* Segmented button group (used by the free-download request form) --
   deliberately square corners, no gap between options. */
.tls-segmented {
	display: flex;
	border: 1px solid #1a1a1a;
	width: fit-content;
}

.tls-segmented-option {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 28px;
	cursor: pointer;
	font-size: 0.9rem;
	color: var(--color-text, #1a1a1a);
	background: transparent;
	border-radius: 0;
	border-right: 1px solid #1a1a1a;
	transition: background 0.2s ease, color 0.2s ease;
}

.tls-segmented-option:last-child {
	border-right: none;
}

.tls-segmented-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tls-segmented-option:has(input:checked) {
	background: var(--color-text, #1a1a1a);
	color: var(--color-bg, #fff);
}

.tls-plan-selector {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 28px;
}

.tls-plan-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border: 1px solid #ccc;
	padding: 14px 18px;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.tls-plan-option:has(input:checked) {
	border-color: var(--color-text, #1a1a1a);
}

.tls-plan-option__left {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.95rem;
}

.tls-plan-option__left input[type="radio"] {
	margin: 0;
}

.tls-plan-option__price {
	font-size: 0.9rem;
	font-weight: 500;
	white-space: nowrap;
}

.tls-price {
	text-align: center;
	margin: 0 0 20px;
}

.tls-price__amount {
	font-family: 'Cormorant Garamond', serif;
	font-size: 2.2rem;
	font-weight: 500;
}

.tls-price__unit {
	font-size: 0.85rem;
	color: #888;
	margin-left: 6px;
}

.tls-field {
	margin-bottom: 28px;
}

.tls-field label {
	display: block;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #666;
	margin-bottom: 8px;
}

.tls-field input[type="text"],
.tls-field input[type="email"],
.tls-field select {
	width: 100%;
	padding: 14px 4px;
	box-sizing: border-box;
	border: none;
	border-bottom: 1px solid #ccc;
	background: transparent;
	font-family: inherit;
	font-size: 1rem;
	color: var(--color-text, #1a1a1a);
	transition: border-color 0.2s ease;
	border-radius: 0;
	-webkit-appearance: none;
	appearance: none;
}

.tls-field input[type="text"]:focus,
.tls-field input[type="email"]:focus,
.tls-field select:focus {
	outline: none;
	border-color: var(--color-text, #1a1a1a);
}

.tls-field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 4px center;
	background-size: 11px 7px;
	padding-right: 20px;
}

.tls-note {
	font-size: 0.85rem;
	color: #888;
	line-height: 1.8;
	margin: -12px 0 28px;
}

.tls-field--terms {
	text-align: center;
}

.tls-field--terms label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-transform: none;
	font-size: 0.85rem;
	letter-spacing: normal;
}

.tls-field--submit {
	text-align: center;
	margin-top: 40px;
}

/* Shared primary button, matching the theme's .btn-primary */
.tls .btn-primary {
	display: inline-block;
	padding: 16px 48px;
	background: var(--color-text, #1a1a1a);
	color: var(--color-bg, #fff);
	border: none;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.8rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.tls .btn-primary:hover {
	opacity: 0.75;
}

/* ---------- Success screen ---------- */

.tls-success__lead {
	font-size: 0.95rem;
	color: #555;
	line-height: 1.9;
	max-width: 440px;
	margin: 0 auto;
}

.tls-key-list {
	margin: 32px 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.tls-key-card {
	border: 1px solid #e2e2e2;
	padding: 20px 24px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.tls-key-card__value {
	font-family: 'Courier New', monospace;
	font-size: 0.95rem;
	letter-spacing: 0.02em;
	flex: 1 1 auto;
	word-break: break-all;
}

.tls-key-card__copy {
	flex: 0 0 auto;
	background: none;
	border: 1px solid var(--color-text, #1a1a1a);
	padding: 8px 18px;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.tls-key-card__copy:hover {
	background: var(--color-text, #1a1a1a);
	color: var(--color-bg, #fff);
}

.tls-howto {
	border-top: 1px solid #e2e2e2;
	padding-top: 40px;
	margin-top: 40px;
	text-align: left;
}

.tls-howto h3 {
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.3rem;
	font-weight: 400;
	margin-bottom: 20px;
}

.tls-howto ol {
	padding-left: 1.2em;
	font-size: 0.9rem;
	line-height: 2;
	color: #444;
	margin-bottom: 16px;
}

.tls-howto__note {
	font-size: 0.8rem;
	color: #999;
	line-height: 1.8;
}

.tls-support {
	margin-top: 40px;
	font-size: 0.85rem;
	color: #888;
	text-align: center;
}

.tls-repeat-purchase {
	text-align: center;
	margin-top: 24px;
}

.tls-repeat-purchase__link {
	display: inline-block;
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	color: #555;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tls-repeat-purchase__link:hover {
	color: var(--color-text, #1a1a1a);
}

/* ---------- Notices ---------- */

.tls-notice {
	text-align: center;
	padding: 60px 40px;
}

.tls-notice p {
	font-size: 0.95rem;
	line-height: 1.9;
}

.tls-notice--error p {
	color: #b3261e;
}

.tls-notice--pending p {
	color: #8a6d3b;
}

.tls-inline-notice {
	margin: 0 0 1.8em;
	padding: 0.9em 1.2em;
	border: 1px solid #e0c68a;
	border-radius: 2px;
	font-size: 0.85rem;
	line-height: 1.8;
}

.tls-inline-notice--pending {
	color: #8a6d3b;
	background: #fbf6ea;
}

@media (max-width: 600px) {
	.tls {
		padding: 56px 24px;
	}

	.tls-plan-option {
		flex-wrap: wrap;
		gap: 6px;
	}
}
