/**
 * Quote Popup Modal Component Styles (Singleton) + Shortcode Button + Contact Form 7 support.
 *
 * @package TMNhanPhat
 */

/* ==========================================================================
   1. SHORTCODE BUTTON STYLES
   ========================================================================== */
.tmnp-quote-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 26px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	border-radius: 999px;
	border: 2px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.tmnp-quote-btn:hover {
	transform: translateY(-2px);
}

.tmnp-quote-btn:active {
	transform: translateY(0);
}

.tmnp-quote-btn--primary {
	background: linear-gradient(135deg, #046AB5 0%, #03518a 100%);
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(4, 106, 181, 0.35);
}

.tmnp-quote-btn--primary:hover {
	background: linear-gradient(135deg, #0579cc 0%, #046AB5 100%);
	box-shadow: 0 8px 24px rgba(4, 106, 181, 0.45);
	color: #ffffff;
}

.tmnp-quote-btn--secondary {
	background: linear-gradient(135deg, #e31f2b 0%, #b8141f 100%);
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(227, 31, 43, 0.35);
}

.tmnp-quote-btn--secondary:hover {
	background: linear-gradient(135deg, #f02b38 0%, #cc1723 100%);
	box-shadow: 0 8px 24px rgba(227, 31, 43, 0.45);
	color: #ffffff;
}

.tmnp-quote-btn--outline {
	background: transparent;
	border-color: #046AB5;
	color: #046AB5;
}

.tmnp-quote-btn--outline:hover {
	background: #046AB5;
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(4, 106, 181, 0.25);
}

.tmnp-quote-btn--light {
	background: #ffffff;
	color: #0a2540;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.tmnp-quote-btn--light:hover {
	background: #f8fafc;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
	color: #046AB5;
}

/* ==========================================================================
   2. MODAL STRUCTURE & BACKDROP
   ========================================================================== */
body.tmnp-modal-open {
	overflow: hidden !important;
	padding-right: var(--scrollbar-width, 0px);
}

.tmnp-quote-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tmnp-quote-modal.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.tmnp-quote-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 20, 44, 0.75);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	cursor: pointer;
}

.tmnp-quote-modal__dialog {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 580px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 22px;
	box-shadow: 0 25px 65px -15px rgba(6, 25, 60, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.04);
	padding: 32px 34px 24px;
	overflow-y: auto;
	transform: translateY(24px) scale(0.97);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	-webkit-overflow-scrolling: touch;
}

.tmnp-quote-modal.is-active .tmnp-quote-modal__dialog {
	transform: translateY(0) scale(1);
}

/* Custom Scrollbar for Modal Dialog */
.tmnp-quote-modal__dialog::-webkit-scrollbar {
	width: 5px;
}

.tmnp-quote-modal__dialog::-webkit-scrollbar-track {
	background: #f8fafc;
	border-radius: 6px;
}

.tmnp-quote-modal__dialog::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 6px;
}

/* Close Button */
.tmnp-quote-modal__close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	color: #64748b;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.25s;
	z-index: 5;
}

.tmnp-quote-modal__close:hover {
	background: #fee2e2;
	border-color: #fecaca;
	color: #ef4444;
	transform: rotate(90deg);
}

/* ==========================================================================
   3. MODAL HEADER & FOOTER
   ========================================================================== */
.tmnp-quote-modal__header {
	margin-bottom: 20px;
	padding-right: 42px;
}

.tmnp-quote-modal__title {
	font-size: 23px;
	font-weight: 800;
	color: #0a2540;
	line-height: 1.25;
	margin: 0 0 6px;
	letter-spacing: -0.015em;
}

.tmnp-quote-modal__desc {
	font-size: 13.5px;
	color: #64748b;
	line-height: 1.5;
	margin: 0;
}

.tmnp-quote-modal__footer {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12.5px;
	color: #64748b;
	flex-wrap: wrap;
	gap: 8px;
}

.tmnp-quote-modal__security {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #475569;
}

.tmnp-quote-modal__hotline strong {
	color: #e31f2b;
	font-weight: 700;
	font-size: 13.5px;
}

/* ==========================================================================
   4. FORM FIELDS & FALLBACK FORM
   ========================================================================== */
.tmnp-quote-modal__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 16px;
}

.quote-field--full {
	grid-column: 1 / -1;
}

.quote-field {
	display: flex;
	flex-direction: column;
}

.quote-field label {
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	margin-bottom: 6px;
	display: flex;
}

.quote-field input[type="text"],
.quote-field input[type="tel"],
.quote-field input[type="email"],
.quote-field select,
.quote-field textarea,
.wpcf7 input[type="text"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="email"],
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	height: 44px;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	padding: 0 14px;
	font-size: 14px;
	color: #0f172a;
	background-color: #f8fafc;
	transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
	font-family: inherit;
	box-sizing: border-box;
}

.quote-field input:focus,
.quote-field select:focus,
.quote-field textarea:focus,
.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
	outline: none;
	border-color: #046AB5;
	background-color: #ffffff;
	box-shadow: 0 0 0 4px rgba(4, 106, 181, 0.12);
}

.quote-field select,
.wpcf7 select {
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.quote-field textarea,
.wpcf7 textarea {
	height: 68px;
	min-height: 68px;
	padding: 10px 14px;
	line-height: 1.5;
	resize: vertical;
}

.quote-field__error {
	font-size: 11.5px;
	color: #ef4444;
	margin-top: 3px;
	min-height: 0;
}

/* Submit Button */
.tmnp-quote-modal__submit-btn,
.wpcf7 input[type="submit"] {
	width: 100%;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 24px;
	margin-top: 10px;
	background: linear-gradient(135deg, #046AB5 0%, #03518a 100%);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.5px;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(4, 106, 181, 0.32);
	transition: background 0.25s, box-shadow 0.25s, transform 0.2s;
}

.tmnp-quote-modal__submit-btn:hover,
.wpcf7 input[type="submit"]:hover {
	background: linear-gradient(135deg, #0579cc 0%, #03518a 100%);
	box-shadow: 0 12px 28px rgba(4, 106, 181, 0.45);
	transform: translateY(-1px);
}

/* ==========================================================================
   5. CONTACT FORM 7 SPECIAL OVERRIDES IN POPUP
   ========================================================================== */
.tmnp-quote-modal__body .wpcf7 form {
	margin: 0;
}

.tmnp-quote-modal__body .wpcf7 p {
	margin: 0;
}

.tmnp-quote-modal__body .wpcf7 br {
	display: none;
}

.tmnp-quote-modal__body .wpcf7 p:empty {
	display: none;
}

.tmnp-quote-modal__body .wpcf7 .tmnp-quote-modal__grid {
	margin-bottom: 4px;
}

.tmnp-quote-modal__body .wpcf7-form-control-wrap {
	display: block;
	position: relative;
	width: 100%;
}

.tmnp-quote-modal__body .wpcf7-not-valid-tip {
	font-size: 12px;
	color: #ef4444;
	font-weight: 500;
	margin-top: 4px;
}

.tmnp-quote-modal__body .wpcf7-response-output {
	margin: 14px 0 0 !important;
	padding: 12px 16px !important;
	border-radius: 10px !important;
	font-size: 13.5px !important;
	line-height: 1.4 !important;
	border: 1px solid transparent !important;
}

.tmnp-quote-modal__body .wpcf7 form.sent .wpcf7-response-output {
	background-color: #f0fdf4 !important;
	border-color: #bbf7d0 !important;
	color: #166534 !important;
}

.tmnp-quote-modal__body .wpcf7 form.failed .wpcf7-response-output,
.tmnp-quote-modal__body .wpcf7 form.invalid .wpcf7-response-output {
	background-color: #fef2f2 !important;
	border-color: #fecaca !important;
	color: #991b1b !important;
}

.tmnp-quote-modal__body .wpcf7-spinner {
	margin: 10px auto 0;
	display: block;
}

/* ==========================================================================
   6. RESPONSIVE OPTIMIZATION
   ========================================================================== */
@media (max-width: 640px) {
	.tmnp-quote-modal {
		padding: 0;
		align-items: flex-end;
	}

	.tmnp-quote-modal__dialog {
		max-height: 92vh;
		border-radius: 20px 20px 0 0;
		padding: 24px 20px 20px;
		margin: 0;
		transform: translateY(100%);
	}

	.tmnp-quote-modal.is-active .tmnp-quote-modal__dialog {
		transform: translateY(0);
	}

	.tmnp-quote-modal__grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.tmnp-quote-modal__title {
		font-size: 20px;
	}

	.tmnp-quote-modal__footer {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
}