/**
 * Parking Pro Manager - Frontend CSS
 * Kompatybilny z Astra/Spectra (używa CSS variables Astra gdy dostępne)
 */

.ppm-wrapper {
	max-width: 720px;
	margin: 0 auto;
	font-family: inherit;
	color: #1f2937;
	box-sizing: border-box;
}

.ppm-wrapper *,
.ppm-wrapper *::before,
.ppm-wrapper *::after {
	box-sizing: inherit;
}

.ppm-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
	overflow: hidden;
}

.ppm-card-no-header .ppm-form {
	padding-top: 28px;
}

.ppm-card-header {
	padding: 28px 24px;
}

.ppm-card-title {
	margin: 0 0 6px;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.3px;
	line-height: 1.2;
}

.ppm-card-subtitle {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	opacity: 0.85;
}

.ppm-form {
	padding: 24px;
}

.ppm-section {
	padding-bottom: 24px;
	margin-bottom: 24px;
	border-bottom: 1px solid #f1f5f9;
}

.ppm-section:last-of-type {
	border-bottom: 0;
}

.ppm-section-label {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #6b7280;
	font-weight: 600;
	margin-bottom: 16px;
}

.ppm-optional {
	color: #9ca3af;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

.ppm-row {
	display: grid;
	gap: 16px;
}

.ppm-row-2 {
	grid-template-columns: 1fr 1fr;
}

@media (max-width: 600px) {
	.ppm-row-2 {
		grid-template-columns: 1fr;
	}
}

.ppm-field {
	display: flex;
	flex-direction: column;
	margin-bottom: 16px;
}

.ppm-field label {
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
}

.ppm-req {
	color: #ef4444;
	font-weight: 700;
}

.ppm-field input[type="text"],
.ppm-field input[type="email"],
.ppm-field input[type="tel"],
.ppm-field input[type="number"],
.ppm-field input[type="date"],
.ppm-field textarea {
	width: 100%;
	padding: 11px 14px;
	font-size: 15px;
	font-family: inherit;
	border: 1.5px solid #e5e7eb;
	border-radius: 8px;
	background: #ffffff;
	color: #1f2937;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	min-height: 44px;
	line-height: 1.4;
}

.ppm-field input:focus,
.ppm-field textarea:focus {
	outline: 0;
	border-color: #2b4fa1;
	box-shadow: 0 0 0 3px rgba(43, 79, 161, 0.15);
}

.ppm-field input.is-invalid,
.ppm-field textarea.is-invalid {
	border-color: #ef4444;
}

.ppm-field input.is-invalid:focus,
.ppm-field textarea.is-invalid:focus {
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.ppm-hint {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: #9ca3af;
	line-height: 1.4;
}

.ppm-error {
	display: block;
	min-height: 16px;
	margin-top: 4px;
	font-size: 12px;
	color: #ef4444;
	font-weight: 500;
}

.ppm-phone-wrap {
	display: flex;
	align-items: stretch;
}

/* Data + godzina obok siebie */
.ppm-datetime-wrap {
	display: flex;
	gap: 8px;
}

.ppm-datetime-wrap input[type="date"] {
	flex: 1;
	min-width: 0;
}

.ppm-datetime-wrap input[type="time"] {
	flex: 0 0 110px;
	min-width: 0;
}

@media (max-width: 480px) {
	.ppm-datetime-wrap {
		flex-direction: column;
		gap: 6px;
	}
	.ppm-datetime-wrap input[type="time"] {
		flex: 1;
	}
}

.ppm-phone-prefix {
	display: flex;
	align-items: center;
	padding: 0 12px;
	background: #f8fafc;
	border: 1.5px solid #e5e7eb;
	border-right: 0;
	border-radius: 8px 0 0 8px;
	font-size: 15px;
	font-weight: 600;
	color: #374151;
}

.ppm-phone-wrap input {
	border-radius: 0 8px 8px 0 !important;
	flex: 1;
}

/* PRICE BOX */
.ppm-price-box {
	margin-top: 16px;
	padding: 20px;
	border-radius: 10px;
	background: linear-gradient(135deg, #f8fafc, #f1f5f9);
	border: 1px solid #e5e7eb;
	text-align: center;
	transition: all 0.25s ease;
}

.ppm-price-box.ppm-price-active {
	background: linear-gradient(135deg, #2b4fa1, #1e3a7a);
	border-color: #2b4fa1;
	color: #ffffff;
}

.ppm-price-box.ppm-price-error {
	background: linear-gradient(135deg, #fef2f2, #fee2e2);
	border-color: #fecaca;
	color: #991b1b;
}

.ppm-price-label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	font-weight: 600;
	opacity: 0.85;
	margin-bottom: 4px;
}

.ppm-price-value {
	font-size: 42px;
	font-weight: 800;
	letter-spacing: -0.5px;
	line-height: 1.1;
}

.ppm-price-empty .ppm-price-value {
	font-size: 16px;
	font-weight: 500;
	color: #6b7280;
}

.ppm-price-meta {
	font-size: 14px;
	margin-top: 8px;
	opacity: 0.95;
	min-height: 20px;
}

.ppm-price-meta .ppm-discount-line {
	display: block;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(255,255,255,0.25);
	font-size: 16px;
	font-weight: 700;
}

/* AVAILABILITY */
.ppm-availability {
	margin-top: 12px;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 6px;
	background: #2b4fa1;
	color: #ffffff;
	border: 1px solid #2b4fa1;
}

.ppm-availability.ppm-availability-low {
	background: #fffbeb;
	color: #92400e;
	border-color: #fcd34d;
}

.ppm-availability.ppm-availability-none {
	background: #fef2f2;
	color: #991b1b;
	border-color: #fecaca;
}

/* DISCOUNT */
.ppm-discount-row {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.ppm-discount-row input {
	flex: 1 1 200px;
	min-width: 0;
	padding: 11px 14px;
	font-size: 15px;
	font-family: inherit;
	border: 1.5px solid #e5e7eb;
	border-radius: 8px;
	min-height: 44px;
}

.ppm-discount-row input:focus {
	outline: 0;
	border-color: #2b4fa1;
	box-shadow: 0 0 0 3px rgba(43, 79, 161, 0.15);
}

.ppm-discount-row .ppm-btn {
	flex: 0 0 auto;
	padding: 12px 18px;
	white-space: nowrap;
}

@media (max-width: 480px) {
	.ppm-discount-row {
		flex-direction: column;
	}
	.ppm-discount-row input,
	.ppm-discount-row .ppm-btn {
		flex: 1 1 100%;
		width: 100%;
	}
}

.ppm-discount-msg {
	min-height: 18px;
	margin-top: 8px;
	font-size: 13px;
	font-weight: 500;
}

.ppm-discount-msg.ppm-success {
	color: #059669;
}

.ppm-discount-msg.ppm-error {
	color: #dc2626;
}

/* PODSUMOWANIE NA KOŃCU - RAZEM DO ZAPŁATY */
.ppm-final-summary {
	background: linear-gradient(135deg, #2b4fa1, #1e3a7a);
	border: 2px solid #2b4fa1;
	border-radius: 12px;
	padding: 20px 24px;
	margin: 20px 0 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	color: #ffffff;
	box-shadow: 0 4px 16px rgba(43, 79, 161, 0.25);
}

.ppm-final-summary-label {
	font-size: 18px;
	font-weight: 700;
	color: #ffffff;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.ppm-final-summary-value {
	font-size: 36px;
	font-weight: 800;
	color: #ffffff;
	line-height: 1;
	letter-spacing: -0.5px;
}

.ppm-final-summary-meta {
	width: 100%;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.85);
	margin-top: 4px;
	text-align: right;
}

@media (max-width: 480px) {
	.ppm-final-summary {
		flex-direction: column;
		text-align: center;
		gap: 8px;
	}
	.ppm-final-summary-label {
		font-size: 14px;
	}
	.ppm-final-summary-value {
		font-size: 32px;
	}
	.ppm-final-summary-meta {
		text-align: center;
	}
}

/* BUTTONS */
.ppm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
	min-height: 44px;
	line-height: 1.2;
}

.ppm-btn-primary {
	background: #2b4fa1;
	color: #ffffff;
	width: 100%;
	font-size: 16px;
	padding: 14px 24px;
	box-shadow: 0 4px 12px rgba(43, 79, 161, 0.3);
}

.ppm-btn-primary:hover:not(:disabled) {
	background: #1e3a7a;
	transform: translateY(-1px);
}

.ppm-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	box-shadow: none;
}

.ppm-btn-secondary {
	background: #f1f5f9;
	color: #1f2937;
	border: 1.5px solid #e5e7eb;
}

.ppm-btn-secondary:hover {
	background: #e5e7eb;
}

.ppm-btn-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: ppm-spin 0.6s linear infinite;
}

.ppm-btn.is-loading .ppm-btn-spinner {
	display: inline-block;
}

@keyframes ppm-spin {
	to { transform: rotate(360deg); }
}

.ppm-submit-row {
	margin-top: 8px;
}

.ppm-submit-info {
	margin: 12px 0 0;
	font-size: 13px;
	color: #6b7280;
	text-align: center;
}

/* HONEYPOT - ukryty dla ludzi, widoczny dla botów */
.ppm-honeypot {
	position: absolute !important;
	left: -9999px !important;
	opacity: 0 !important;
	pointer-events: none !important;
	height: 0 !important;
	overflow: hidden !important;
}

/* NOTICES */
.ppm-notice {
	margin-top: 20px;
	padding: 14px 18px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
	border-left: 4px solid;
}

.ppm-notice-success {
	background: #ecfdf5;
	color: #065f46;
	border-color: #10b981;
}

.ppm-notice-error {
	background: #fef2f2;
	color: #991b1b;
	border-color: #ef4444;
}

.ppm-notice-warning {
	background: #fffbeb;
	color: #92400e;
	border-color: #f59e0b;
}

.ppm-notice strong {
	display: block;
	margin-bottom: 4px;
	font-size: 15px;
}

/* CHECKBOX REGULAMIN */
.ppm-section-terms {
	background: #f8fafc;
	padding: 16px;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
}

.ppm-checkbox-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.5;
	color: #1f2937;
}

.ppm-checkbox-row input[type="checkbox"] {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: #2b4fa1;
	cursor: pointer;
}

.ppm-checkbox-text {
	flex: 1;
}

.ppm-checkbox-text a {
	color: #2b4fa1;
	text-decoration: underline;
}

.ppm-checkbox-text a:hover {
	color: #1e3a7a;
}

.ppm-checkbox-row.is-invalid {
	color: #dc2626;
}

.ppm-checkbox-row.is-invalid input[type="checkbox"] {
	outline: 2px solid #dc2626;
	outline-offset: 2px;
}

/* SUCCESS BOX (po wysłaniu) */
.ppm-success-box {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 40px 24px;
	text-align: center;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
}

.ppm-success-icon {
	width: 64px;
	height: 64px;
	background: #10b981;
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	font-weight: 700;
	margin: 0 auto 16px;
}

.ppm-success-box h3 {
	margin: 0 0 8px;
	font-size: 22px;
	color: #1f2937;
}

.ppm-success-box p {
	margin: 0 0 20px;
	color: #6b7280;
	font-size: 15px;
}

/* URLOP - dłuższy napis w ramce ceny (np. "W tym terminie rezerwacja jest niemożliwa") */
.ppm-price-value.ppm-price-long {
	font-size: 28px;
	line-height: 1.25;
	letter-spacing: 0;
	overflow-wrap: anywhere;
}

@media (max-width: 480px) {
	.ppm-price-value.ppm-price-long {
		font-size: 22px;
	}
}
