/**
 * Front-end styles.
 *
 * Written defensively so an opinionated theme cannot flatten the button:
 * colours come from custom properties set inline from the settings, and layout
 * avoids inheriting theme button rules.
 */

:root {
	--nkwo-btn-bg: #25d366;
	--nkwo-btn-fg: #ffffff;
	--nkwo-float-x: 20px;
	--nkwo-float-y: 20px;
}

/* ---------------------------------------------------------------- Panel */

.nkwo-panel {
	margin: 2em 0;
	padding: 1.5em;
	border: 1px solid rgba( 0, 0, 0, 0.1 );
	border-radius: 10px;
	background: rgba( 37, 211, 102, 0.05 );
}

.nkwo-panel__title {
	margin: 0 0 0.75em;
	font-size: 1.25em;
	line-height: 1.3;
}

.nkwo-panel__intro {
	margin: 0 0 1.25em;
	line-height: 1.6;
}

.nkwo-panel__sent {
	margin: 0.75em 0 0;
	font-size: 0.875em;
	opacity: 0.75;
}

.nkwo-notice {
	margin: 1em 0 0;
	padding: 0.75em 1em;
	border-left: 3px solid var( --nkwo-btn-bg );
	background: rgba( 0, 0, 0, 0.03 );
	font-size: 0.9em;
	line-height: 1.5;
}

/* ---------------------------------------------------------------- Steps */

.nkwo-steps {
	margin: 0 0 1.25em;
	padding: 0;
	list-style: none;
	counter-reset: nkwo-step;
}

.nkwo-steps__item {
	position: relative;
	margin: 0 0 0.5em;
	padding-left: 2.25em;
	line-height: 1.5;
	counter-increment: nkwo-step;
	opacity: 0.55;
}

.nkwo-steps__item::before {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	width: 1.6em;
	height: 1.6em;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.12 );
	content: counter( nkwo-step );
	font-size: 0.8em;
	font-weight: 700;
}

.nkwo-steps__item.is-done {
	opacity: 0.7;
}

.nkwo-steps__item.is-done::before {
	background: var( --nkwo-btn-bg );
	color: var( --nkwo-btn-fg );
	content: "\2713";
}

.nkwo-steps__item.is-current {
	font-weight: 600;
	opacity: 1;
}

.nkwo-steps__item.is-current::before {
	background: var( --nkwo-btn-bg );
	color: var( --nkwo-btn-fg );
}

/* --------------------------------------------------------------- Button */

.nkwo-button {
	display: inline-flex;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	padding: 0.9em 1.6em;
	border: 2px solid var( --nkwo-btn-bg );
	border-radius: 8px;
	background: var( --nkwo-btn-bg );
	color: var( --nkwo-btn-fg );
	font-size: 1.05em;
	font-weight: 600;
	gap: 0.6em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.nkwo-button:hover,
.nkwo-button:focus {
	color: var( --nkwo-btn-fg );
	opacity: 0.88;
	text-decoration: none;
}

.nkwo-button--block {
	width: 100%;
}

.nkwo-button--outline {
	background: transparent;
	color: var( --nkwo-btn-bg );
}

.nkwo-button--outline:hover,
.nkwo-button--outline:focus {
	background: var( --nkwo-btn-bg );
	color: var( --nkwo-btn-fg );
	opacity: 1;
}

.nkwo-button__icon {
	flex: 0 0 auto;
}

/* ------------------------------------------------------------- Fallback */

.nkwo-fallback {
	margin-top: 1.25em;
	font-size: 0.9em;
}

.nkwo-fallback > summary {
	cursor: pointer;
	opacity: 0.75;
}

.nkwo-fallback__text {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 0.75em 0;
	padding: 0.75em;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 6px;
	background: #fff;
	font-family: inherit;
	font-size: 0.95em;
	line-height: 1.5;
	resize: vertical;
}

.nkwo-copy {
	padding: 0.5em 1em;
	border: 1px solid rgba( 0, 0, 0, 0.2 );
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 0.9em;
}

.nkwo-copy.is-copied {
	border-color: var( --nkwo-btn-bg );
	color: var( --nkwo-btn-bg );
}

/* --------------------------------------------------------- Sticky panel */

.nkwo-panel--sticky {
	position: fixed;
	z-index: 9998;
	right: 0;
	bottom: 0;
	left: 0;
	margin: 0;
	padding: 0.75em 1em calc( 0.75em + env( safe-area-inset-bottom, 0px ) );
	border: 0;
	border-top: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 0;
	background: #fff;
	box-shadow: 0 -2px 16px rgba( 0, 0, 0, 0.12 );
}

/* ------------------------------------------------------ Floating button */

.nkwo-float {
	position: fixed;
	z-index: 9999;
	bottom: var( --nkwo-float-y );
	display: inline-flex;
	align-items: center;
	padding: 0.85em;
	border-radius: 999px;
	background: var( --nkwo-btn-bg );
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.22 );
	color: var( --nkwo-btn-fg );
	gap: 0.5em;
	line-height: 1;
	text-decoration: none;
}

.nkwo-float:hover,
.nkwo-float:focus {
	color: var( --nkwo-btn-fg );
	opacity: 0.92;
	text-decoration: none;
}

.nkwo-float--right {
	right: var( --nkwo-float-x );
}

.nkwo-float--left {
	left: var( --nkwo-float-x );
}

.nkwo-float__label {
	padding-right: 0.35em;
	font-size: 0.95em;
	font-weight: 600;
}

@media ( max-width: 767px ) {
	.nkwo-float--desktop-only {
		display: none;
	}

	.nkwo-float__label {
		display: none;
	}
}

@media ( min-width: 768px ) {
	.nkwo-float--mobile-only {
		display: none;
	}
}

/* ------------------------------------------------------------- Enquiry */

.nkwo-enquiry {
	margin: 1em 0;
}

/* Respect users who prefer reduced motion. */
@media ( prefers-reduced-motion: reduce ) {
	.nkwo-button {
		transition: none;
	}
}
