/* FormTools - all selectors are prefixed with .ft- so they don't clash with Elementor or the theme */

.ft-root {
	--ft-ink: #1c2530;
	--ft-muted: #5b6776;
	--ft-line: #d5dbe3;
	--ft-paper: #ffffff;
	--ft-wash: #f4f6f9;
	--ft-accent: #2250d8;
	--ft-accent-dark: #173ba3;
	--ft-ok: #12714a;
	--ft-error: #b42318;
	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto;
	color: var(--ft-ink);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

.ft-root *,
.ft-root *::before,
.ft-root *::after {
	box-sizing: inherit;
}

.ft-drop {
	display: block;
	border: 2px dashed var(--ft-line);
	border-radius: 10px;
	background: var(--ft-wash);
	padding: 36px 20px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

.ft-drop:hover,
.ft-drop:focus-within,
.ft-drop.ft-over {
	border-color: var(--ft-accent);
	background: #eef2fd;
}

.ft-drop input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.ft-drop-title {
	display: block;
	font-size: 1.15rem;
	font-weight: 600;
	margin: 0 0 4px;
}

.ft-drop-sub {
	display: block;
	color: var(--ft-muted);
	font-size: 0.9rem;
}

.ft-privacy {
	margin: 10px 0 0;
	color: var(--ft-muted);
	font-size: 0.85rem;
	text-align: center;
}

.ft-list {
	list-style: none;
	margin: 18px 0 0;
	padding: 0;
	border: 1px solid var(--ft-line);
	border-radius: 10px;
	overflow: hidden;
}

.ft-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	background: var(--ft-paper);
	border-bottom: 1px solid var(--ft-line);
}

.ft-item:last-child {
	border-bottom: 0;
}

.ft-thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 6px;
	background: var(--ft-wash) center / cover no-repeat;
	border: 1px solid var(--ft-line);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--ft-accent-dark);
}

.ft-meta {
	flex: 1 1 auto;
	min-width: 0;
}

.ft-name {
	display: block;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ft-size {
	display: block;
	color: var(--ft-muted);
	font-size: 0.85rem;
}

.ft-actions {
	display: flex;
	gap: 4px;
	flex: 0 0 auto;
}

.ft-icon-btn {
	appearance: none;
	width: 36px;
	height: 36px;
	border: 1px solid var(--ft-line);
	border-radius: 6px;
	background: var(--ft-paper);
	color: var(--ft-ink);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
}

.ft-icon-btn:hover:not(:disabled) {
	background: var(--ft-wash);
}

.ft-icon-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.ft-icon-btn:focus-visible,
.ft-btn:focus-visible,
.ft-select:focus-visible {
	outline: 3px solid var(--ft-accent);
	outline-offset: 2px;
}

.ft-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 14px;
	margin: 18px 0 0;
}

.ft-field label {
	display: block;
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 4px;
}

.ft-select {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--ft-line);
	border-radius: 6px;
	background: var(--ft-paper);
	color: var(--ft-ink);
	font-size: 1rem;
}

.ft-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 20px 0 0;
}

.ft-btn {
	appearance: none;
	border: 0;
	border-radius: 8px;
	padding: 12px 22px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
}

.ft-btn-primary {
	background: var(--ft-accent);
	color: #fff;
}

.ft-btn-primary:hover:not(:disabled) {
	background: var(--ft-accent-dark);
}

.ft-btn-primary:disabled {
	background: #9fb0e6;
	cursor: not-allowed;
}

.ft-btn-quiet {
	background: var(--ft-wash);
	color: var(--ft-ink);
	border: 1px solid var(--ft-line);
}

.ft-btn-quiet:hover {
	background: #e9edf2;
}

.ft-status {
	margin: 16px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 0.95rem;
}

.ft-status:empty {
	display: none;
}

.ft-status-info {
	background: var(--ft-wash);
	color: var(--ft-ink);
}

.ft-status-warn {
	background: #fff6e0;
	color: #6b4a00;
}

.ft-status-error {
	background: #fdecea;
	color: var(--ft-error);
}

.ft-result {
	margin: 20px 0 0;
	padding: 16px;
	border: 1px solid #b9dfcd;
	background: #eefaf4;
	border-radius: 10px;
}

.ft-result p {
	margin: 0 0 12px;
	color: var(--ft-ok);
	font-weight: 600;
}

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

@media (max-width: 480px) {
	.ft-drop {
		padding: 28px 14px;
	}
	.ft-btn {
		width: 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ft-drop {
		transition: none;
	}
}

/* ---- Theme-proofing (Astra / Elementor often restyle lists and links) ---- */
.ft-root ul.ft-list {
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.ft-root ul.ft-list li.ft-item {
	margin: 0;
	padding: 10px 12px;
	list-style: none;
}

.ft-root ul.ft-list li.ft-item::marker {
	content: "";
}

.ft-root a.ft-btn,
.ft-root a.ft-btn:visited,
.ft-root a.ft-btn:hover,
.ft-root a.ft-btn:focus {
	color: #ffffff;
	text-decoration: none;
}

.ft-root a.ft-btn-primary:hover {
	background: var(--ft-accent-dark);
}

.ft-root p {
	max-width: none;
}

/* ---- Resize image tool ---- */
.ft-source {
	margin-top: 18px;
	border: 1px solid var(--ft-line);
	border-radius: 10px;
}

.ft-thumb {
	background-size: cover;
	background-position: center;
	transition: transform 0.2s;
}

.ft-root input.ft-select {
	height: auto;
	margin: 0;
}

.ft-preview {
	display: block;
	max-width: 100%;
	max-height: 320px;
	height: auto;
	margin: 0 0 14px;
	border: 1px solid var(--ft-line);
	border-radius: 6px;
	background: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.ft-thumb {
		transition: none;
	}
}

/* ---- Crop box (resize tool) ---- */
.ft-crop {
	margin: 18px 0 0;
	text-align: center;
}

.ft-crop-help {
	margin: 0 0 10px;
	color: var(--ft-muted);
	font-size: 0.9rem;
}

.ft-crop-canvas {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	border: 1px solid var(--ft-line);
	border-radius: 6px;
	background: #fff;
	cursor: grab;
	touch-action: none;
}

.ft-crop-canvas:active {
	cursor: grabbing;
}

.ft-crop-canvas:focus-visible {
	outline: 3px solid var(--ft-accent);
	outline-offset: 2px;
}

.ft-zoom {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 12px auto 0;
	max-width: 420px;
}

.ft-zoom label {
	font-weight: 600;
	font-size: 0.9rem;
}

.ft-zoom input[type="range"] {
	flex: 1 1 auto;
	min-width: 0;
}

.ft-btn-small {
	padding: 8px 14px;
	font-size: 0.9rem;
}

.ft-crop-size {
	margin: 8px 0 0;
	color: var(--ft-muted);
	font-size: 0.85rem;
}

@media (max-width: 480px) {
	.ft-zoom .ft-btn {
		width: auto;
	}
}

/* ---- Compress PDF tool ---- */
.ft-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 14px 0 0;
}

.ft-chip {
	width: auto;
}

.ft-check-field {
	display: flex;
	align-items: flex-end;
}

.ft-check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
	cursor: pointer;
	margin: 0 0 8px;
}

.ft-check input {
	width: 18px;
	height: 18px;
	margin: 0;
}

.ft-note {
	margin: 14px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fff6e0;
	color: #6b4a00;
	font-size: 0.9rem;
}

/* ---- PDF page tools ---- */
.ft-tight {
	margin: 14px 0 0;
}

.ft-wide {
	grid-column: 1 / -1;
}

.ft-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	margin: 14px 0 0;
}

.ft-card {
	border: 1px solid var(--ft-line);
	border-radius: 10px;
	background: var(--ft-paper);
	padding: 10px;
	text-align: center;
}

.ft-card-off {
	opacity: 0.45;
}

.ft-card-thumb {
	height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ft-wash);
	border-radius: 6px;
	overflow: hidden;
	color: var(--ft-muted);
}

.ft-card-thumb img {
	max-width: 100%;
	max-height: 100%;
	display: block;
	transition: transform 0.2s;
}

.ft-card-label {
	margin: 8px 0;
	font-size: 0.85rem;
	font-weight: 600;
}

.ft-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	justify-content: center;
}

.ft-card-actions .ft-icon-btn {
	width: 30px;
	height: 30px;
	font-size: 0.9rem;
}

.ft-card .ft-btn {
	width: 100%;
	text-align: center;
}

.ft-results-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 18px 0 0;
}

.ft-results-bar p {
	margin: 0;
	font-weight: 600;
}

.ft-result p + a + p {
	margin-top: 18px;
}

@media (prefers-reduced-motion: reduce) {
	.ft-card-thumb img {
		transition: none;
	}
}

/* ---- Photo sheet tool ---- */
.ft-note-info {
	background: var(--ft-wash);
	color: var(--ft-ink);
}

.ft-dl-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

@media (max-width: 480px) {
	.ft-dl-row .ft-btn {
		width: 100%;
	}
}

/* ---- Clean signature tool ---- */
.ft-sigprev {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	margin: 18px 0 0;
	padding: 14px;
	border: 1px solid var(--ft-line);
	border-radius: 10px;
	background: #fff;
}

.ft-sigprev.ft-checker {
	background-color: #fff;
	background-image:
		linear-gradient(45deg, #e4e8ee 25%, transparent 25%, transparent 75%, #e4e8ee 75%),
		linear-gradient(45deg, #e4e8ee 25%, transparent 25%, transparent 75%, #e4e8ee 75%);
	background-size: 20px 20px;
	background-position: 0 0, 10px 10px;
}

.ft-sigcanvas {
	display: block;
	max-width: 100%;
	height: auto;
}

.ft-field input[type="range"] {
	width: 100%;
	margin: 8px 0 0;
}

/* ---- Sign PDF tool ---- */
.ft-h3 {
	margin: 22px 0 8px;
	font-size: 1.05rem;
	font-weight: 700;
}

.ft-signbox {
	margin: 18px 0 0;
	padding: 14px;
	border: 1px solid var(--ft-line);
	border-radius: 10px;
	background: var(--ft-paper);
}

.ft-signbox .ft-h3 {
	margin-top: 0;
}

.ft-tabs {
	display: flex;
	gap: 6px;
	margin: 0 0 12px;
}

.ft-tab {
	appearance: none;
	border: 1px solid var(--ft-line);
	border-radius: 8px;
	background: var(--ft-wash);
	color: var(--ft-ink);
	padding: 8px 14px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.ft-tab-on {
	background: var(--ft-accent);
	border-color: var(--ft-accent);
	color: #fff;
}

.ft-pad {
	display: block;
	width: 100%;
	max-width: 640px;
	height: auto;
	border: 1px dashed var(--ft-line);
	border-radius: 8px;
	background: #fff;
	touch-action: none;
	cursor: crosshair;
}

.ft-padbar,
.ft-textbar,
.ft-pagebar,
.ft-selbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 10px 0 0;
}

.ft-textbar .ft-text-in {
	flex: 1 1 200px;
	width: auto;
}

.ft-textbar .ft-select,
.ft-padbar .ft-select {
	width: auto;
}

.ft-pagebar {
	justify-content: space-between;
}

.ft-pageno {
	font-weight: 600;
}

.ft-sigready {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin: 12px 0 0;
}

.ft-sigthumb {
	max-width: 200px;
	max-height: 80px;
	background-color: #fff;
	background-image:
		linear-gradient(45deg, #e4e8ee 25%, transparent 25%, transparent 75%, #e4e8ee 75%),
		linear-gradient(45deg, #e4e8ee 25%, transparent 25%, transparent 75%, #e4e8ee 75%);
	background-size: 14px 14px;
	background-position: 0 0, 7px 7px;
	border: 1px solid var(--ft-line);
	border-radius: 6px;
	padding: 4px;
}

.ft-viewer {
	position: relative;
	max-width: 760px;
	margin: 10px auto 0;
	line-height: 0;
	border: 1px solid var(--ft-line);
	background: #fff;
	box-shadow: 0 2px 8px rgba(28, 37, 48, 0.08);
}

.ft-viewer-canvas {
	display: block;
	width: 100%;
	height: auto;
}

.ft-overlay {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.ft-pitem {
	position: absolute;
	cursor: move;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	outline: 1px dashed transparent;
}

.ft-pitem img {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
}

.ft-pitem-text {
	line-height: 1;
	white-space: nowrap;
	font-family: Helvetica, Arial, sans-serif;
}

.ft-pitem-sel {
	outline: 2px dashed var(--ft-accent);
}

.ft-handle {
	display: none;
	position: absolute;
	right: -10px;
	bottom: -10px;
	width: 20px;
	height: 20px;
	border-radius: 4px;
	background: var(--ft-accent);
	cursor: nwse-resize;
	touch-action: none;
}

.ft-pitem-sel .ft-handle {
	display: block;
}

.ft-selbar .ft-btn {
	width: auto;
}

/* ---- Theme-proof hover and focus colours (some themes turn buttons pink) ---- */
.ft-root .ft-tab-on,
.ft-root .ft-tab-on:hover,
.ft-root .ft-tab-on:focus {
	background: #2250d8;
	border-color: #2250d8;
	color: #fff;
}

.ft-root .ft-tab:not(.ft-tab-on):hover,
.ft-root .ft-tab:not(.ft-tab-on):focus {
	background: #e9edf2;
	border-color: #d5dbe3;
	color: #1c2530;
}

.ft-root .ft-btn-quiet:hover,
.ft-root .ft-btn-quiet:focus {
	background: #e9edf2;
	color: #1c2530;
}

.ft-root .ft-btn-primary:hover,
.ft-root .ft-btn-primary:focus {
	background: #173ba3;
	color: #fff;
}

.ft-root .ft-icon-btn:hover:not(:disabled),
.ft-root .ft-icon-btn:focus {
	background: #f4f6f9;
	color: #1c2530;
}

.ft-root .ft-btn-primary:disabled {
	background: #9fb0e6;
	color: #fff;
}
