/* ============================================================
   [Barfide] PDF Gate — Modal styles
   Design: teal #2d7d6e / accent bar #7a1515
   All rules scoped under #barfide-pdf-modal to prevent theme conflicts.
   ============================================================ */

/* ============================================================
   CSS custom properties (global scope needed for :root)
   ============================================================ */

:root {
	--bpg-primary:      #2d7d6e;
	--bpg-primary-dark: #1f6457;
	--bpg-accent-bar:   #7a1515;
	--bpg-text:         #333333;
	--bpg-muted:        #888888;
	--bpg-placeholder:  #333333;
	--bpg-border:       #d0d0d0;
	--bpg-bg:           #ffffff;
	--bpg-overlay:      rgba(0, 0, 0, 0.5);
	--bpg-radius-box:   12px;
	--bpg-radius-input: 5px;
	--bpg-shadow:       0 20px 60px rgba(0, 0, 0, .25);
}

/* ============================================================
   Overlay & wrapper
   ============================================================ */

#barfide-pdf-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

#barfide-pdf-modal[hidden] {
	display: none;
}

#barfide-pdf-modal .bpg-modal__overlay {
	position: absolute;
	inset: 0;
	background: var(--bpg-overlay);
	cursor: pointer;
}

/* ============================================================
   Modal box
   ============================================================ */

#barfide-pdf-modal .bpg-modal__box {
	position: relative;
	z-index: 1;
	background: var(--bpg-bg);
	border-radius: var(--bpg-radius-box);
	box-shadow: var(--bpg-shadow);
	width: 100%;
	max-width: 528px;
	overflow: hidden;
	animation: bpg-in .22s ease both;
}

@keyframes bpg-in {
	from { opacity: 0; transform: translateY(-14px) scale(.98); }
	to   { opacity: 1; transform: none; }
}

/* ============================================================
   Header — logo left / title right
   ============================================================ */

#barfide-pdf-modal .bpg-modal__header {
	background: var(--bpg-primary);
	border-bottom: 6px solid var(--bpg-accent-bar);
	padding: 18px 49px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

/* Logo */
#barfide-pdf-modal .bpg-modal__logo {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex-shrink: 0;
}

#barfide-pdf-modal .bpg-modal__logo-img {
	width: 143px;
	height: 37px;
	display: block;
}

#barfide-pdf-modal .bpg-modal__logo-fallback {
	font-size: 21px;
	font-weight: 900;
	font-style: italic;
	color: #fff;
	letter-spacing: .5px;
	line-height: 1;
}


/* Title — Antonio Regular 26px per XD spec */
#barfide-pdf-modal .bpg-modal__title {
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	font-family: 'Antonio', sans-serif;
	font-size: 26px;
	font-weight: 400;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.26px;
	line-height: 1.2;
	text-align: right;
}

/* ============================================================
   Form body
   ============================================================ */

#barfide-pdf-modal .bpg-modal__form {
	padding: 19px 49px 40px;
	margin: 0;
}

/* Subtitle — Roboto Regular 14px per XD spec */
#barfide-pdf-modal .bpg-modal__subtitle {
	margin: 0 0 22px;
	padding: 0;
	font-family: 'Roboto', sans-serif;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.14px;
	color: var(--bpg-primary);
	text-align: center;
	line-height: 1.4;
}

/* ============================================================
   Fields with inline icons
   ============================================================ */

#barfide-pdf-modal .bpg-form__field {
	margin-bottom: 0;
}

/* 23px gap between consecutive input fields */
#barfide-pdf-modal .bpg-form__field + .bpg-form__field {
	margin-top: 23px;
}

/* 14px gap before RGPD (smaller than inter-field gap) */
#barfide-pdf-modal .bpg-form__field--checkbox {
	margin-top: 14px !important;
}

/* Labels: visually hidden, kept for accessibility */
#barfide-pdf-modal .bpg-form__field > label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Input wrapper */
#barfide-pdf-modal .bpg-input-wrap {
	position: relative;
}

#barfide-pdf-modal .bpg-input-wrap input[type="text"],
#barfide-pdf-modal .bpg-input-wrap input[type="email"] {
	display: block;
	width: 100%;
	height: 42px;
	padding: 0 14px 0 44px;
	border: 0.75px solid var(--bpg-border);
	border-radius: var(--bpg-radius-input);
	font-family: 'Roboto', sans-serif;
	font-size: 14px;
	font-weight: 400;
	color: var(--bpg-text);
	background: #fff;
	box-shadow: none;
	box-sizing: border-box;
	outline: none;
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
}

#barfide-pdf-modal .bpg-input-wrap input[type="text"]::placeholder,
#barfide-pdf-modal .bpg-input-wrap input[type="email"]::placeholder {
	color: var(--bpg-placeholder);
	opacity: 1;
}

#barfide-pdf-modal .bpg-input-wrap input[type="text"]:focus,
#barfide-pdf-modal .bpg-input-wrap input[type="email"]:focus {
	border-color: var(--bpg-primary);
	border-width: 0.75px;
	box-shadow: 0 0 0 2px rgba(45, 125, 110, .12);
	outline: none;
}

/* Inline icon */
#barfide-pdf-modal .bpg-input-icon {
	position: absolute;
	left: 13px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	pointer-events: none;
	background-repeat: no-repeat;
	background-size: contain;
	background-position: center;
	opacity: .4;
}

#barfide-pdf-modal .bpg-input-icon--nom {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 21v-1a8 8 0 0 1 16 0v1'/%3E%3C/svg%3E");
}

#barfide-pdf-modal .bpg-input-icon--societe {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='M16 7V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2'/%3E%3C/svg%3E");
}

#barfide-pdf-modal .bpg-input-icon--email {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m2 8 10 7 10-7'/%3E%3C/svg%3E");
}

/* ============================================================
   RGPD checkbox
   ============================================================ */

#barfide-pdf-modal .bpg-form__field--checkbox {
	margin-bottom: 0;
}

#barfide-pdf-modal .bpg-form__field--checkbox label {
	position: static !important;
	width: auto !important;
	height: auto !important;
	overflow: visible !important;
	clip: auto !important;
	white-space: normal !important;

	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-family: 'Roboto', sans-serif;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.13px;
	color: #333333;
	cursor: pointer;
	line-height: 13.2px;
	text-align: center;
}

#barfide-pdf-modal .bpg-form__field--checkbox input[type="checkbox"] {
	flex-shrink: 0;
	width: 13px;
	height: 13px;
	accent-color: var(--bpg-primary);
	cursor: pointer;
}

#barfide-pdf-modal .bpg-form__field--checkbox a {
	color: var(--bpg-primary);
	text-decoration: none;
	font-weight: 400;
}

#barfide-pdf-modal .bpg-form__field--checkbox a:hover {
	text-decoration: underline;
}

/* ============================================================
   Messages
   ============================================================ */

#barfide-pdf-modal .bpg-form__message {
	margin: 8px 0;
	padding: 10px 14px;
	border-radius: 6px;
	font-family: 'Roboto', sans-serif;
	font-size: 13px;
	line-height: 1.5;
}

#barfide-pdf-modal .bpg-form__message[hidden] {
	display: none;
}

#barfide-pdf-modal .bpg-form__message--error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

#barfide-pdf-modal .bpg-form__message--info {
	background: #f0fdf8;
	color: var(--bpg-primary);
	border: 1px solid #a7f3d0;
}

/* ============================================================
   Submit button — Roboto Medium 16px, 216×33px per XD spec
   ============================================================ */

#barfide-pdf-modal .bpg-form__submit {
	display: block !important;
	width: 216px !important;
	height: 33px !important;
	margin: 45px auto 0 !important;
	padding: 0 !important;
	background: var(--bpg-primary) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 7px !important;
	box-shadow: none !important;
	font-family: 'Roboto', sans-serif !important;
	font-size: 16px !important;
	font-weight: 500 !important;
	letter-spacing: 0.64px !important;
	text-transform: uppercase !important;
	text-decoration: none !important;
	cursor: pointer;
	transition: background .15s, transform .1s;
	line-height: 33px !important;
	appearance: none;
}

#barfide-pdf-modal .bpg-form__submit:hover:not(:disabled) {
	background: var(--bpg-primary-dark) !important;
}

#barfide-pdf-modal .bpg-form__submit:active:not(:disabled) {
	transform: scale(.98);
}

#barfide-pdf-modal .bpg-form__submit:disabled {
	opacity: .55;
	cursor: not-allowed;
}

/* ============================================================
   Success state
   ============================================================ */

#barfide-pdf-modal .bpg-modal__success {
	padding: 40px 28px;
	text-align: center;
}

#barfide-pdf-modal .bpg-modal__success[hidden] {
	display: none;
}

#barfide-pdf-modal .bpg-success__icon {
	width: 52px;
	height: 52px;
	background: var(--bpg-primary);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: #fff;
	margin: 0 auto 14px;
}

#barfide-pdf-modal .bpg-modal__success p {
	font-family: 'Roboto', sans-serif;
	font-size: 15px;
	color: var(--bpg-text);
	margin: 0;
	line-height: 1.6;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 560px) {
	#barfide-pdf-modal .bpg-modal__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		padding: 14px 20px;
	}

	#barfide-pdf-modal .bpg-modal__title {
		font-size: 20px;
		text-align: left;
	}

	#barfide-pdf-modal .bpg-modal__form {
		padding: 16px 20px 28px;
	}

	#barfide-pdf-modal .bpg-form__submit {
		width: 100% !important;
	}
}

/* ============================================================
   Catalogue button (shortcode — outside modal)
   ============================================================ */

.barfide-pdf-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 22px;
	background: var(--bpg-primary) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 6px;
	font-family: 'Roboto', sans-serif;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .15s;
	text-decoration: none;
	appearance: none;
}

.barfide-pdf-btn:hover {
	background: var(--bpg-primary-dark) !important;
}

.barfide-pdf-btn::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 16l-6-6h4V4h4v6h4l-6 6zM5 20v-2h14v2H5z'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
}
