/* ==========================================================================
   Text to PDF Converter — scoped styles
   All selectors are nested under .ttpdf-wrap to avoid theme conflicts.
   ========================================================================== */

.ttpdf-wrap {
	--ttpdf-blue: #3461fd;
	--ttpdf-blue-dark: #2748c9;
	--ttpdf-blue-tint: #eef2ff;
	--ttpdf-amber: #ee8b2f;
	--ttpdf-ink: #12141c;
	--ttpdf-muted: #6b7280;
	--ttpdf-border: #e5e7eb;
	--ttpdf-bg: #ffffff;
	--ttpdf-panel-bg: #f7f8fa;
	--ttpdf-radius: 16px;
	--ttpdf-radius-sm: 10px;
	--ttpdf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	font-family: var(--ttpdf-font);
	color: var(--ttpdf-ink);
	background: var(--ttpdf-bg);
	border: 1px solid var(--ttpdf-border);
	border-radius: var(--ttpdf-radius);
	padding: 28px;
	max-width: 980px;
	margin: 0 auto;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.04);
	box-sizing: border-box;
}

.ttpdf-wrap *,
.ttpdf-wrap *::before,
.ttpdf-wrap *::after {
	box-sizing: border-box;
}

/* ---------- Header ---------- */

.ttpdf-header {
	text-align: center;
	margin-bottom: 20px;
}

.ttpdf-eyebrow {
	display: inline-block;
	background: var(--ttpdf-blue-tint);
	color: var(--ttpdf-blue);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 4px 12px;
	border-radius: 999px;
	margin-bottom: 10px;
}

.ttpdf-title {
	font-size: 26px;
	font-weight: 800;
	color: var(--ttpdf-ink);
	margin: 0 0 6px;
	line-height: 1.25;
}

.ttpdf-subtitle {
	font-style: italic;
	color: var(--ttpdf-blue-dark);
	font-size: 14px;
	margin: 0;
}

/* ---------- Step indicator ---------- */

.ttpdf-steps {
	display: flex;
	justify-content: center;
	gap: 28px;
	flex-wrap: wrap;
	margin-bottom: 22px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--ttpdf-border);
}

.ttpdf-step {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ttpdf-step-num {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--ttpdf-blue);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.ttpdf-step-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--ttpdf-muted);
}

/* ---------- Tabs ---------- */

.ttpdf-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--ttpdf-border);
}

.ttpdf-tab {
	appearance: none;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 10px 4px;
	margin-right: 20px;
	font-size: 14px;
	font-weight: 700;
	color: var(--ttpdf-muted);
	cursor: pointer;
	font-family: inherit;
}

.ttpdf-tab.is-active {
	color: var(--ttpdf-blue);
	border-bottom-color: var(--ttpdf-blue);
}

/* ---------- Layout grid ---------- */

.ttpdf-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: 28px;
	align-items: start;
}

.ttpdf-label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--ttpdf-amber);
	margin-bottom: 6px;
	margin-top: 14px;
}

.ttpdf-col-main .ttpdf-label {
	margin-top: 0;
}

/* ---------- Toolbar ---------- */

.ttpdf-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	background: var(--ttpdf-panel-bg);
	border: 1px solid var(--ttpdf-border);
	border-radius: var(--ttpdf-radius-sm) var(--ttpdf-radius-sm) 0 0;
	padding: 6px;
}

.ttpdf-tool {
	appearance: none;
	background: #fff;
	border: 1px solid var(--ttpdf-border);
	border-radius: 6px;
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	font-size: 13px;
	color: var(--ttpdf-ink);
	cursor: pointer;
	font-family: inherit;
}

.ttpdf-tool:hover {
	background: var(--ttpdf-blue-tint);
	border-color: var(--ttpdf-blue);
	color: var(--ttpdf-blue-dark);
}

.ttpdf-tool.is-active {
	background: var(--ttpdf-blue);
	border-color: var(--ttpdf-blue);
	color: #fff;
}

.ttpdf-tool-sep {
	width: 1px;
	height: 20px;
	background: var(--ttpdf-border);
	margin: 0 4px;
}

.ttpdf-tool-clear {
	margin-left: auto;
	color: #b42318;
}

/* ---------- Editor ---------- */

.ttpdf-editor {
	min-height: 260px;
	max-height: 480px;
	overflow-y: auto;
	border: 1px solid var(--ttpdf-border);
	border-top: none;
	border-radius: 0 0 var(--ttpdf-radius-sm) var(--ttpdf-radius-sm);
	padding: 16px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--ttpdf-ink);
	background: #fff;
}

.ttpdf-editor:focus {
	outline: none;
	box-shadow: inset 0 0 0 2px var(--ttpdf-blue);
}

.ttpdf-editor:empty::before {
	content: attr(data-placeholder);
	color: #9ca3af;
}

.ttpdf-editor h3 {
	font-size: 19px;
	font-weight: 800;
	margin: 0 0 8px;
}

.ttpdf-editor h4 {
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 8px;
}

.ttpdf-editor p {
	margin: 0 0 10px;
}

/* ---------- Dropzone ---------- */

.ttpdf-dropzone {
	margin-top: 12px;
	border: 2px dashed var(--ttpdf-border);
	border-radius: var(--ttpdf-radius-sm);
	padding: 18px;
	text-align: center;
	background: var(--ttpdf-panel-bg);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.ttpdf-dropzone.is-dragover {
	border-color: var(--ttpdf-blue);
	background: var(--ttpdf-blue-tint);
}

.ttpdf-dropzone-icon {
	font-size: 18px;
	color: var(--ttpdf-blue);
}

.ttpdf-dropzone-text {
	font-size: 13px;
	color: var(--ttpdf-muted);
}

.ttpdf-upload-btn {
	display: inline-block;
	background: #fff;
	border: 1px solid var(--ttpdf-blue);
	color: var(--ttpdf-blue);
	font-size: 13px;
	font-weight: 700;
	padding: 6px 16px;
	border-radius: 8px;
	cursor: pointer;
}

.ttpdf-upload-btn:hover {
	background: var(--ttpdf-blue-tint);
}

.ttpdf-error {
	color: #b42318;
	font-size: 13px;
	margin-top: 10px;
}

/* ---------- Side column: stats + options ---------- */

.ttpdf-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 6px;
}

.ttpdf-stat-box {
	background: var(--ttpdf-panel-bg);
	border-radius: var(--ttpdf-radius-sm);
	padding: 12px;
	text-align: center;
}

.ttpdf-stat-box-accent {
	grid-column: span 2;
	background: var(--ttpdf-blue-tint);
}

.ttpdf-stat-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ttpdf-muted);
	margin-bottom: 4px;
}

.ttpdf-stat-value {
	display: block;
	font-size: 20px;
	font-weight: 800;
	color: var(--ttpdf-blue-dark);
}

.ttpdf-select {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--ttpdf-border);
	border-radius: 8px;
	font-size: 13px;
	font-family: inherit;
	color: var(--ttpdf-ink);
	background: #fff;
}

.ttpdf-select:focus {
	outline: none;
	border-color: var(--ttpdf-blue);
}

.ttpdf-convert-btn {
	appearance: none;
	width: 100%;
	background: var(--ttpdf-blue);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 14px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	margin-top: 18px;
	font-family: inherit;
	transition: background 0.15s ease;
}

.ttpdf-convert-btn:hover {
	background: var(--ttpdf-blue-dark);
}

.ttpdf-convert-btn:disabled {
	background: #a5b4fc;
	cursor: not-allowed;
}

.ttpdf-privacy-note {
	text-align: center;
	font-size: 11.5px;
	color: var(--ttpdf-muted);
	margin: 10px 0 0;
}

/* ---------- Image tab ---------- */

.ttpdf-image-list {
	list-style: none;
	margin: 14px 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 10px;
}

.ttpdf-image-list li {
	position: relative;
	border: 1px solid var(--ttpdf-border);
	border-radius: 8px;
	overflow: hidden;
	background: var(--ttpdf-panel-bg);
	aspect-ratio: 1 / 1;
}

.ttpdf-image-list img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ttpdf-image-remove {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: none;
	background: rgba(18, 20, 28, 0.7);
	color: #fff;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
	.ttpdf-wrap {
		padding: 18px;
	}

	.ttpdf-grid {
		grid-template-columns: 1fr;
	}

	.ttpdf-steps {
		gap: 16px;
	}

	.ttpdf-step-label {
		display: none;
	}

	.ttpdf-title {
		font-size: 21px;
	}

	.ttpdf-tool {
		min-width: 30px;
		height: 30px;
		font-size: 12px;
	}
}
