/* Bare-bones layout for the TypeTester / BuyForm islands. The legacy
 * styles.css (copied from new/css/) provides the production look; this file
 * only fills in island-specific styles missing from the legacy CSS until we
 * decide whether to fully rewrite the CSS. */

.tester {
	padding: 24px;
	margin-bottom: 8px;
}
.tester__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: center;
	margin-bottom: 32px;
}
.tester__control {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}
.tester__control label {
	min-width: 56px;
	color: currentColor;
}
.tester__control input[type='range'] {
	width: 120px;
}
.tester__control output {
	min-width: 32px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.tester__control select {
	padding: 4px 12px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	font: inherit;
}
.tester__control--size {
	margin-left: auto;
}
.tester__preview {
	min-height: 100px;
	outline: none;
	white-space: pre-wrap;
	word-break: break-word;
	overflow: visible;
}
.tester__preview:focus {
	outline: 2px solid rgba(130, 25, 200, 0.2);
	outline-offset: 4px;
}
.tester--dark {
	background: #000;
	color: #fff;
}
.tester--dark .tester__control select,
.tester--dark .tester__opentype__toggle {
	background: #111;
	color: #fff;
	border-color: #333;
}

/* Preview block grows with the content — matches live behavior where the
 * whole section expands as text wraps. Don't pin a max-height. */
.tester__preview--multicol {
	columns: 3;
	column-gap: 24px;
}
@media (max-width: 900px) {
	.tester__preview--multicol { columns: 1; }
}

/* Alignment buttons */
.tester__align {
	display: flex;
	gap: 4px;
}
.tester__align__btn {
	width: 32px;
	height: 32px;
	border: 1px solid #ddd;
	background: #fff;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
}
.tester__align__btn.is-active {
	background: #172C12;
	color: #fff;
}
.tester--dark .tester__align__btn {
	background: #111;
	border-color: #333;
	color: #fff;
}
.tester--dark .tester__align__btn.is-active {
	background: #fff;
	color: #172C12;
}

/* OpenType picker */
.tester__opentype { position: relative; }
.tester__opentype__toggle {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 4px 12px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	font: inherit;
	cursor: pointer;
}
.tester__opentype__count {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.tester__opentype__menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 5;
	min-width: 220px;
	max-height: 320px;
	overflow: auto;
	margin: 0;
	padding: 8px;
	background: #fff;
	color: #172C12;
	border: 1px solid #ddd;
	border-radius: 8px;
	list-style: none;
	box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.tester__opentype__menu li label {
	display: flex;
	gap: 8px;
	padding: 6px 4px;
	font-size: 13px;
	cursor: pointer;
}

/* Hide secondary tester sections on small screens (matches live `.s-hide`). */
.tester--characters,
.tester--display {
	display: block;
}
@media (max-width: 700px) {
	.tester--characters,
	.tester--display,
	.tester--headline:nth-of-type(n+3) {
		display: none;
	}
}

/* Glyph table */
.glyph-table {
	padding: 64px 24px;
}
.glyph-table__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
	gap: 4px;
}
.glyph-table__list li {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border: 1px solid #ddd;
	color: #8219c8;
	font-size: 28px;
	border-radius: 6px;
}
.glyph-table__count {
	margin-top: 16px;
	color: #666;
	font-size: 14px;
}

/* Font detail page layout */
.font-detail__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding-top: 32px;
	padding-bottom: 16px;
}
.font-detail__title { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.font-detail__title .preview__title {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
}
.font-detail__title .preview__submenu {
	display: flex;
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.font-detail__title .preview__submenu a {
	color: #8219c8;
	text-decoration: none;
}
.font-detail__cta {
	position: sticky;
	top: 16px;
	z-index: 10;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 12px 20px;
	background: #8219c8;
	color: #fff !important;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 600;
}
.font-detail__cta .preview__button__price {
	font-size: 11px;
	opacity: 0.85;
	line-height: 1.1;
	padding-left: 12px;
	border-left: 1px solid rgba(255,255,255,0.4);
}

/* Below-the-tester two-column area (about + buy). Stacks on small screens. */
.font-detail__below {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 48px;
	padding-top: 64px;
}
.font-detail__copy h3.h1 { margin-top: 0; }
.font-detail__copy p { line-height: 1.5; }
.font-detail__copy .text__button {
	display: inline-block;
	padding: 12px 24px;
	background: rgba(130,25,200,0.1);
	color: #8219c8;
	border-radius: 999px;
	text-decoration: none;
	margin: 12px 0;
}
.font-detail__buy .buyform {
	margin-top: 0;
}
@media (max-width: 900px) {
	.font-detail__below {
		grid-template-columns: 1fr;
	}
}

/* BuyForm — two-step flow matching live nctype.com */
.buyform {
	background: #8219c8;
	color: #fff;
	padding: 40px 32px;
	border-radius: 12px;
}
.buyform__inner { max-width: 100%; }
.buyform__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	margin-bottom: 32px;
	flex-wrap: wrap;
}
.buyform__head h2 { margin: 0; font-size: 28px; font-weight: 700; }
.buyform__tagline { margin: 0; font-size: 14px; opacity: 0.9; }
.buyform__tagline strong { font-weight: 700; }

.buyform__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 24px;
}
.buyform__field > span {
	font-size: 13px;
	opacity: 0.85;
}
.buyform__field select,
.buyform__inputs select,
.buyform__inputs input,
.buyform .buyform__share-result input {
	width: 100%;
	padding: 14px 18px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: transparent;
	color: #fff;
	font: inherit;
	box-sizing: border-box;
}
.buyform__inputs input::placeholder { color: rgba(255, 255, 255, 0.7); }
.buyform__inputs select option { color: #172C12; }
.buyform__field select { background: rgba(0, 0, 0, 0.15); }

.buyform__vat-wrap { position: relative; }
.buyform__vat-status {
	display: block;
	margin-top: 4px;
	padding-left: 18px;
	font-size: 12px;
	opacity: 0.85;
}
.buyform__vat-status.is-ok { color: #b6f3a6; opacity: 1; }
.buyform__vat-status.is-err { color: #ffb3b3; opacity: 1; }

.buyform__section-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 32px 0 4px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
	font-size: 14px;
	opacity: 0.85;
}
.buyform__section-h {
	font-size: 18px;
	font-weight: 700;
	margin: 32px 0 16px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.buyform__row {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 16px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.buyform__row.is-selected { font-weight: 700; }
.buyform__row__main {
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
}
.buyform__row input[type="checkbox"] {
	appearance: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid rgba(255, 255, 255, 0.7);
	border-radius: 3px;
	background: transparent;
	cursor: pointer;
}
.buyform__row input[type="checkbox"]:checked {
	background: rgba(255, 255, 255, 0.9);
	border-color: #fff;
}
.buyform__remove {
	background: none;
	border: 0;
	color: rgba(255, 255, 255, 0.8);
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
}
.buyform__price {
	min-width: 60px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.buyform__total-line {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin: 32px 0 24px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.3);
	font-size: 24px;
}
.buyform__total-line strong { font-size: 32px; }

.buyform__cta {
	display: block;
	width: 100%;
	padding: 18px 32px;
	border-radius: 999px;
	background: #fff;
	color: #172C12;
	border: 0;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}
.buyform__cta[disabled] {
	background: rgba(255, 255, 255, 0.3);
	cursor: not-allowed;
}

.buyform__or {
	text-align: center;
	opacity: 0.7;
	margin: 16px 0;
}
.buyform__sharelink {
	display: block;
	width: 100%;
	padding: 12px 16px;
	background: transparent;
	border: 0;
	color: #fff;
	text-align: center;
	font: inherit;
	cursor: pointer;
}
.buyform__sharelink[disabled] { opacity: 0.5; cursor: not-allowed; }

.buyform__share-result {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}
.buyform__share-result input {
	flex: 1;
	font-size: 13px;
}
.buyform__share-result button {
	padding: 10px 16px;
	background: #fff;
	color: #172C12;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	font: inherit;
}

/* Checkout step */
.buyform--checkout .buyform__inputs {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.buyform__label {
	margin: 8px 0;
	font-size: 14px;
	opacity: 0.9;
}
.buyform__radios {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 12px 0 24px;
}
.buyform__radios label {
	display: flex;
	gap: 8px;
	cursor: pointer;
}

.buyform__summary { margin-top: 24px; }
.buyform__summary__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}
.buyform__edit {
	background: none;
	border: 0;
	color: rgba(255, 255, 255, 0.85);
	font: inherit;
	cursor: pointer;
}
.buyform__summary__row {
	display: flex;
	justify-content: space-between;
	padding: 12px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.buyform__summary__total {
	display: flex;
	justify-content: space-between;
	margin-top: 16px;
	padding-top: 16px;
	font-size: 24px;
}

.buyform__eula {
	display: flex;
	gap: 12px;
	margin: 24px 0;
	font-size: 14px;
	line-height: 1.4;
}
.buyform__eula a { color: #fff; text-decoration: underline; }

.buyform__error {
	color: #ffd0d0;
	margin: 12px 0;
}

/* hide leftover legacy details block (no longer used) */
.buyform__legacy-details {
	display: none;
}
.buyform__details--full {
	grid-column: 1 / -1;
}
.buyform__total {
	margin-top: 32px;
	font-size: 18px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 16px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.3);
}
