/* ============================================================
   ChiCamp Kody Rabatowe – Frontend modal styles
   ============================================================ */

/* ── Scroll lock ─────────────────────────────────────────── */
.cdc-body-lock {
	overflow: hidden;
}

/* ── Modal root ──────────────────────────────────────────── */
#cdc-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	align-items: center;
	justify-content: center;
}

#cdc-modal.is-open {
	display: flex;
}

/* ── Overlay ─────────────────────────────────────────────── */
.cdc-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

/* ── Dialog box ──────────────────────────────────────────── */
.cdc-dialog {
	position: relative;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
	padding: 2rem 2.25rem 2.25rem;
	width: 100%;
	max-width: 480px;
	margin: 1rem;
	z-index: 1;
	max-height: 92vh;
	overflow-y: auto;
}

/* ── Close button ────────────────────────────────────────── */
.cdc-close {
	position: absolute;
	top: 0.75rem;
	right: 1rem;
	background: none;
	border: none;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	color: #888;
	padding: 0;
	transition: color 0.15s;
}
.cdc-close:hover { color: #111; }

/* ── Typography ──────────────────────────────────────────── */
.cdc-dialog__title {
	margin: 0 0 0.6rem;
	font-size: 1.35rem;
	line-height: 1.3;
	padding-right: 1.5rem; /* avoid overlap with close btn */
}

.cdc-dialog__intro {
	font-size: 0.88rem;
	color: #555;
	margin: 0 0 1.4rem;
	line-height: 1.5;
}

/* ── Fields ──────────────────────────────────────────────── */
.cdc-field {
	margin-bottom: 1.2rem;
}

.cdc-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
	font-size: 0.93rem;
}

/* Checkbox field */
.cdc-field--check .cdc-check-label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	font-weight: normal;
	cursor: pointer;
	line-height: 1.5;
	font-size: 0.93rem;
}

.cdc-field--check input[type="checkbox"] {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	margin-top: 2px;
	cursor: pointer;
	accent-color: #0073aa;
}

/* Text input */
.cdc-field input[type="text"] {
	width: 100%;
	padding: 0.55rem 0.8rem;
	border: 1px solid #bbb;
	border-radius: 5px;
	font-size: 1rem;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.cdc-field input[type="text"]:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

/* Hint below input */
.cdc-hint {
	display: block;
	font-size: 0.8rem;
	margin-top: 0.3rem;
	min-height: 1.1em;
	color: #888;
}
.cdc-hint--warn { color: #c0392b; }
.cdc-hint--ok   { color: #27ae60; }

/* ── Error box ───────────────────────────────────────────── */
.cdc-error {
	background: #fff0ef;
	border: 1px solid #e74c3c;
	color: #b71c1c;
	border-radius: 5px;
	padding: 0.6rem 0.85rem;
	font-size: 0.9rem;
	margin-bottom: 1rem;
	line-height: 1.5;
}

/* ── Buttons ─────────────────────────────────────────────── */
.cdc-btn {
	background: #00C7BE;
	color: white;
	border: none;
	border-radius: 30px;
	padding: 16px 24px;
	font-size: 18px;
	font-weight: 700;
	line-height: 20px;
	display: block;
	cursor: pointer;
	text-decoration: none;
	-webkit-transition: 0.5s all;
	-moz-transition: 0.5s all;
	transition: 0.5s all;
}

.cdc-btn:hover {
	background: #0693EE;
	color: white;
}

.cdc-btn:disabled {
	opacity: 0.42;
	cursor: not-allowed;
}

.cdc-btn--primary {
	width: 100%;
	margin-top: 0.5rem;
}

.cdc-btn--secondary {
	display: inline-block;
}

/* ── Result step ─────────────────────────────────────────── */
.cdc-code-box {
	font-size: 1.9rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-align: center;
	background: #f4f8fc;
	border: 2px dashed #0073aa;
	border-radius: 7px;
	padding: 1.1rem 1rem;
	margin: 0.5rem 0 1rem;
	word-break: break-all;
	color: #003d6b;
}

.cdc-code-notice {
	font-size: 0.85rem;
	color: #c0392b;
	font-style: italic;
	margin: 0 0 1.2rem;
	line-height: 1.5;
}

.cdc-result-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.cdc-copy-ok {
	color: #27ae60;
	font-size: 0.9rem;
	font-weight: 600;
}

/* ── Widget button ───────────────────────────────────────── */
.cdc-widget .cdc-open-modal {
	cursor: pointer;
}
