/* =============================================================
   Nikmehr — «پیش‌فاکتور فوری» modal
   Centred dialog opened from the header quote button. Reuses the
   .nik-cart-locked scroll-lock class and the design tokens from main.css.
   ============================================================= */

.nik-proforma-overlay {
	position: fixed; inset: 0; z-index: 140;
	background: rgba(11,28,69,.5);
	opacity: 0; transition: opacity .3s ease;
}
.nik-proforma-overlay.is-open { opacity: 1; }

.nik-proforma {
	position: fixed; z-index: 150; inset: 0; margin: auto;
	width: min(94vw, 460px); max-height: min(92vh, 640px);
	display: flex; flex-direction: column;
	background: #fff; color: var(--nik-text);
	border-radius: var(--nik-radius);
	box-shadow: 0 24px 70px -16px rgba(11,28,69,.55);
	/* Parked: scaled down + faded until opened. */
	opacity: 0; visibility: hidden;
	transform: translateY(12px) scale(.96);
	transition: opacity .25s ease, transform .25s cubic-bezier(.22,1,.36,1), visibility .25s;
}
.nik-proforma.is-open {
	opacity: 1; visibility: visible;
	transform: translateY(0) scale(1);
}
.nik-proforma.is-busy { pointer-events: none; }
.nik-proforma.is-busy .nik-proforma__form { opacity: .55; transition: opacity .15s ease; }

.nik-proforma__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 20px; border-bottom: 1px solid var(--nik-border); flex-shrink: 0;
}
.nik-proforma__title {
	margin: 0; font-size: 17px; font-weight: 800; color: var(--nik-primary);
}
.nik-proforma__close {
	display: inline-flex; padding: 4px; background: none; border: 0; cursor: pointer;
	color: var(--nik-text-soft); transition: color .15s ease;
}
.nik-proforma__close:hover { color: var(--nik-accent-600); }

.nik-proforma__note {
	display: flex; align-items: center; gap: 8px;
	margin: 0; padding: 12px 20px;
	font-size: 13px; font-weight: 700; line-height: 1.6;
	color: var(--nik-success); background: var(--nik-success-bg);
}
.nik-proforma__note-icon { flex-shrink: 0; }

.nik-proforma__form {
	display: flex; flex-direction: column; gap: 14px;
	padding: 18px 20px 20px;
	overflow-y: auto; overscroll-behavior: contain;
}

.nik-proforma__field { display: flex; flex-direction: column; gap: 6px; }
.nik-proforma__formal {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	padding: 12px;
	border: 1px solid var(--nik-border);
	border-radius: var(--nik-radius-sm);
	background: rgba(11,28,69,.025);
}
.nik-proforma__formal[hidden] { display: none; }
.nik-proforma__field--wide { grid-column: 1 / -1; }
.nik-proforma__label {
	font-size: 13px; font-weight: 700; color: var(--nik-text);
}
.nik-proforma__input,
.nik-proforma__textarea {
	width: 100%; padding: 10px 12px;
	font-family: var(--nik-font); font-size: 14px; color: var(--nik-text);
	background: var(--nik-bg-soft);
	border: 1px solid var(--nik-border); border-radius: var(--nik-radius-sm);
	transition: border-color .15s ease, background .15s ease;
}
.nik-proforma__input:focus,
.nik-proforma__textarea:focus {
	outline: none; border-color: var(--nik-accent); background: #fff;
}
.nik-proforma__textarea { resize: vertical; min-height: 88px; line-height: 1.7; }
.nik-proforma__input::placeholder,
.nik-proforma__textarea::placeholder { color: var(--nik-text-faint); }

/* formal / informal single-choice toggle. */
.nik-proforma__types {
	display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.nik-proforma__type {
	padding: 10px 12px; cursor: pointer;
	font-family: var(--nik-font); font-size: 14px; font-weight: 700;
	color: var(--nik-text-soft); background: var(--nik-bg-soft);
	border: 1px solid var(--nik-border); border-radius: var(--nik-radius-sm);
	transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.nik-proforma__type:hover { border-color: var(--nik-accent); }
.nik-proforma__type.is-active {
	color: var(--nik-primary); background: #fff;
	border-color: var(--nik-accent); box-shadow: inset 0 0 0 1px var(--nik-accent);
}

/* Inline validation. */
.nik-proforma__field.has-error .nik-proforma__input,
.nik-proforma__field.has-error .nik-proforma__textarea {
	border-color: #c0392b; background: rgba(192,57,43,.04);
}
.nik-proforma__error { font-size: 12px; font-weight: 600; color: #c0392b; }

/* Status message. */
.nik-proforma__feedback {
	margin: 0; font-size: 13.5px; font-weight: 700; line-height: 1.8;
}
.nik-proforma__feedback:empty { display: none; }
.nik-proforma__feedback.is-success {
	padding: 12px 14px; border-radius: var(--nik-radius-sm);
	color: var(--nik-success); background: var(--nik-success-bg);
}
.nik-proforma__feedback.is-error { color: #c0392b; }

.nik-proforma__submit {
	padding: 12px 16px; cursor: pointer;
	font-family: var(--nik-font); font-size: 15px; font-weight: 800;
	color: #1a1a1a; background: var(--nik-accent);
	border: 0; border-radius: var(--nik-radius-sm);
	transition: background .15s ease;
}
.nik-proforma__submit:hover { background: var(--nik-accent-600); }
.nik-proforma__submit:disabled { opacity: .6; cursor: default; }

/* Honeypot — visually hidden but reachable to bots. */
.nik-proforma__hp {
	position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

@media (max-width: 480px) {
	.nik-proforma { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; }
	.nik-proforma__formal { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.nik-proforma, .nik-proforma-overlay { transition: opacity .2s ease; }
	.nik-proforma { transform: none; }
}
