/* ------------------------------------------------------------------ */
/* VitalTalk Content Agreements — Frontend Modal                        */
/* ------------------------------------------------------------------ */

/* Scroll lock — prevents page scrolling behind the modal */
html.vbp-modal-open,
body.vbp-modal-open {
	overflow: hidden !important;
}

.vbp-overlay {
	display: flex;
	align-items: center;
	justify-content: center;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	z-index: 999999;
	padding: 16px;
	box-sizing: border-box;
}

.vbp-popup {
	background: #ffffff;
	border-radius: 10px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
	display: flex;
	flex-direction: column;
	max-width: 720px;
	width: 100%;
	max-height: 88vh;
	overflow: hidden;
}

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

.vbp-popup__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 16px;
	border-bottom: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.vbp-popup__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	color: #111111;
	line-height: 1.3;
}

.vbp-popup__close {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.75rem;
	line-height: 1;
	color: #777777;
	padding: 0 2px;
	transition: color 0.15s ease;
	flex-shrink: 0;
	margin-left: 12px;
}

.vbp-popup__close:hover,
.vbp-popup__close:focus {
	color: #111111;
	outline: none;
}

/* Body --------------------------------------------------------------- */

.vbp-popup__body {
	padding: 20px 24px;
	overflow-y: auto;
	flex: 1 1 auto;
	font-size: 0.9375rem;
	line-height: 1.75;
	color: #333333;
	-webkit-overflow-scrolling: touch;
}

.vbp-popup__body h1,
.vbp-popup__body h2,
.vbp-popup__body h3,
.vbp-popup__body h4 {
	margin-top: 1.2em;
	margin-bottom: 0.4em;
	color: #111111;
}

.vbp-popup__body p  { margin: 0 0 0.9em; }

.vbp-popup__body a {
	color: #0062cc;
	text-decoration: underline;
}

.vbp-popup__body a:hover { color: #004299; }

.vbp-popup__body ul,
.vbp-popup__body ol {
	padding-left: 1.4em;
	margin: 0 0 0.9em;
}

.vbp-popup__body img {
	max-width: 100%;
	height: auto;
}

/* Scroll hint -------------------------------------------------------- */

.vbp-scroll-hint {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 24px;
	background: #f8f8f8;
	border-top: 1px solid #e8e8e8;
	font-size: 0.8125rem;
	color: #555555;
	flex-shrink: 0;
	transition: opacity 0.3s ease, max-height 0.3s ease;
	overflow: hidden;
	max-height: 48px;
}

.vbp-scroll-hint--hidden {
	opacity: 0;
	max-height: 0;
	padding-top: 0;
	padding-bottom: 0;
	border-top-color: transparent;
	pointer-events: none;
}

.vbp-scroll-hint__arrow {
	display: inline-block;
	animation: vbp-bounce 1.2s ease infinite;
}

@keyframes vbp-bounce {
	0%, 100% { transform: translateY(0); }
	50%       { transform: translateY(3px); }
}

/* Footer ------------------------------------------------------------- */

.vbp-popup__footer {
	padding: 16px 24px 20px;
	border-top: 1px solid #e8e8e8;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex-shrink: 0;
}

.vbp-popup__footer-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.vbp-popup__footer-row--end {
	justify-content: flex-end;
}

/* Custom field inputs */

.vbp-custom-field-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
}

.vbp-custom-field-wrap label {
	white-space: nowrap;
	font-size: 0.9375rem;
	color: #333333;
	font-weight: 500;
	min-width: 130px;
}

.vbp-custom-field-input {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid #cccccc;
	border-radius: 5px;
	font-size: 0.9375rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vbp-custom-field-input:focus {
	border-color: #0062cc;
	box-shadow: 0 0 0 2px rgba(0, 98, 204, 0.2);
	outline: none;
}

/* Password field */

.vbp-password-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.vbp-password-wrap label {
	white-space: nowrap;
	font-size: 0.9375rem;
	color: #333333;
	font-weight: 500;
}

.vbp-password-input {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid #cccccc;
	border-radius: 5px;
	font-size: 0.9375rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vbp-password-input:focus {
	border-color: #0062cc;
	box-shadow: 0 0 0 2px rgba(0, 98, 204, 0.2);
	outline: none;
}

.vbp-password-input.vbp-input--error {
	border-color: #d63638;
	box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.2);
}

/* Agree checkbox */

.vbp-agree-checkbox-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9375rem;
	color: #333333;
}

.vbp-agree-checkbox-wrap input[type="checkbox"] {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	cursor: pointer;
}

/* Error message */

.vbp-error-msg {
	color: #d63638;
	font-size: 0.875rem;
	font-weight: 500;
	display: none;
}

.vbp-error-msg--visible { display: block; }

/* Buttons */

.vbp-btn-agree {
	background: #0062cc;
	color: #ffffff;
	border: none;
	border-radius: 5px;
	padding: 10px 30px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease, opacity 0.2s ease;
	white-space: nowrap;
}

.vbp-btn-agree:hover:not(:disabled) { background: #004299; }

.vbp-btn-agree:active:not(:disabled) { transform: scale(0.97); }

.vbp-btn-agree:focus {
	outline: 3px solid #7db8f7;
	outline-offset: 2px;
}

.vbp-btn-agree:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

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

@media ( max-width: 520px ) {
	.vbp-popup {
		max-height: 92vh;
		border-radius: 8px;
	}

	.vbp-popup__header { padding: 16px 16px 12px; }

	.vbp-popup__title { font-size: 1.1rem; }

	.vbp-popup__body { padding: 16px; font-size: 0.875rem; }

	.vbp-popup__footer { padding: 12px 16px 16px; }

	.vbp-password-wrap { flex-direction: column; align-items: stretch; }

	.vbp-popup__footer-row--end { justify-content: stretch; }

	.vbp-btn-agree { width: 100%; text-align: center; }
}
