/* Consultas por Derecho Penal — formulario */
.cdp {
	--cdp-primary: #0f1c2e;
	--cdp-accent: #b8925a;
	--cdp-text: #1b2533;
	--cdp-muted: #5f6977;
	--cdp-line: #d9dde3;
	--cdp-bg: #ffffff;
	--cdp-soft: #f5f6f8;
	--cdp-err: #b3261e;
	--cdp-ok: #1f7a4a;
	--cdp-radius: 10px;
	box-sizing: border-box;
	width: 100%;
	max-width: 860px;
	margin: 0 auto;
	color: var(--cdp-text);
	font-size: 16px;
	line-height: 1.5;
}
.cdp *, .cdp *::before, .cdp *::after { box-sizing: border-box; }

.cdp__head { margin-bottom: 24px; }
.cdp__title { margin: 0 0 8px; color: var(--cdp-primary); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.2; }
.cdp__lead { margin: 0; color: var(--cdp-muted); max-width: 62ch; }

.cdp__form {
	background: var(--cdp-bg);
	border: 1px solid var(--cdp-line);
	border-radius: calc(var(--cdp-radius) + 4px);
	padding: clamp(18px, 4vw, 36px);
	box-shadow: 0 1px 2px rgba(15, 28, 46, .04), 0 12px 32px -18px rgba(15, 28, 46, .25);
}

.cdp__block { border: 0; margin: 0 0 28px; padding: 0; min-width: 0; }
.cdp__block + .cdp__block { padding-top: 26px; border-top: 1px solid var(--cdp-line); }
.cdp__step {
	display: flex; align-items: center; gap: 10px;
	padding: 0; margin: 0 0 18px;
	font-weight: 700; font-size: 1.05rem; color: var(--cdp-primary);
	float: left; width: 100%; /* saca el legend del borde del fieldset */
}
.cdp__step + * { clear: both; }
.cdp__step span {
	display: inline-grid; place-items: center;
	width: 28px; height: 28px; border-radius: 50%;
	background: var(--cdp-primary); color: #fff; font-size: .85rem; flex: none;
}
.cdp__step b, .cdp label b, .cdp__label b { color: var(--cdp-accent); font-weight: 700; }

.cdp__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.cdp__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.cdp__field--full, .cdp__urgent { grid-column: 1 / -1; }

.cdp__field > label, .cdp__label { font-weight: 600; font-size: .92rem; }
.cdp__field small { font-weight: 400; color: var(--cdp-muted); }

.cdp input[type="text"], .cdp input[type="tel"], .cdp input[type="email"], .cdp select, .cdp textarea {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	font: inherit;
	font-size: 16px; /* evita zoom en iOS */
	color: var(--cdp-text);
	background: #fff;
	border: 1px solid var(--cdp-line);
	border-radius: var(--cdp-radius);
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none; appearance: none;
	margin: 0;
}
.cdp select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235f6977' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 14px center;
}
.cdp textarea { min-height: 130px; resize: vertical; }
.cdp input::placeholder, .cdp textarea::placeholder { color: #9aa2ad; }
.cdp input:focus, .cdp select:focus, .cdp textarea:focus {
	outline: none;
	border-color: var(--cdp-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cdp-accent) 35%, transparent);
}
.cdp__count { align-self: flex-end; font-size: .78rem; color: var(--cdp-muted); }

/* Chips (radios) */
.cdp__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cdp__chip { position: relative; cursor: pointer; margin: 0; }
.cdp__chip input, .cdp__lawyer input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cdp__chip span {
	display: inline-flex; align-items: center; min-height: 42px;
	padding: 9px 14px; border: 1px solid var(--cdp-line); border-radius: 999px;
	font-size: .92rem; background: #fff; transition: all .15s ease;
}
.cdp__chip:hover span { border-color: var(--cdp-primary); }
.cdp__chip input:checked + span { background: var(--cdp-primary); border-color: var(--cdp-primary); color: #fff; }
.cdp__chip input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cdp-accent) 45%, transparent); }

/* Urgencia */
.cdp__urgent {
	padding: 14px 16px; border-radius: var(--cdp-radius);
	background: #fdf1ef; border: 1px solid #f1c6bf; color: #6d1a14; font-size: .93rem;
}
.cdp__urgent[hidden] { display: none; }
.cdp__urgent-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cdp__urgent-btns a {
	display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px;
	background: var(--cdp-err); color: #fff !important; border-radius: 8px; text-decoration: none !important; font-weight: 600;
}

/* Abogados */
.cdp__lawyers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cdp__lawyer { position: relative; cursor: pointer; margin: 0; display: block; }
.cdp__lawyer-box {
	display: flex; flex-direction: column; gap: 4px; height: 100%;
	padding: 16px 16px 16px 48px; border: 1px solid var(--cdp-line); border-radius: var(--cdp-radius);
	background: #fff; transition: all .15s ease; position: relative;
}
.cdp__lawyer-box::before {
	content: ""; position: absolute; left: 16px; top: 18px; width: 20px; height: 20px;
	border: 2px solid var(--cdp-line); border-radius: 50%; background: #fff; transition: all .15s ease;
}
.cdp__lawyer:hover .cdp__lawyer-box { border-color: var(--cdp-primary); }
.cdp__lawyer input:checked + .cdp__lawyer-box {
	border-color: var(--cdp-primary); background: var(--cdp-soft);
	box-shadow: inset 0 0 0 1px var(--cdp-primary);
}
.cdp__lawyer input:checked + .cdp__lawyer-box::before { border-color: var(--cdp-primary); background: var(--cdp-primary); box-shadow: inset 0 0 0 4px #fff; }
.cdp__lawyer input:focus-visible + .cdp__lawyer-box { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cdp-accent) 45%, transparent); }
.cdp__lawyer-name { font-weight: 700; color: var(--cdp-primary); }
.cdp__lawyer-meta { font-size: .87rem; color: var(--cdp-muted); }
.cdp__lawyer-tel { font-size: .85rem; color: var(--cdp-accent); font-weight: 600; }

/* Pie */
.cdp__footer { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; border-top: 1px solid var(--cdp-line); }
.cdp__consent { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; margin: 0; }
.cdp__consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--cdp-primary); }
.cdp__submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%; min-height: 54px; padding: 14px 28px;
	font: inherit; font-weight: 700; font-size: 1rem; letter-spacing: .01em;
	color: #fff; background: var(--cdp-primary); border: 0; border-radius: var(--cdp-radius);
	cursor: pointer; transition: transform .1s ease, filter .15s ease;
}
.cdp__submit:hover { filter: brightness(1.15); }
.cdp__submit:active { transform: translateY(1px); }
.cdp__submit:focus-visible { outline: 3px solid var(--cdp-accent); outline-offset: 2px; }
.cdp__submit[disabled] { opacity: .7; cursor: progress; }
.cdp__spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: cdp-spin .7s linear infinite; }
.cdp__form.is-sending .cdp__spinner { display: inline-block; }
@keyframes cdp-spin { to { transform: rotate(360deg); } }
.cdp__privacy { margin: 0; font-size: .82rem; color: var(--cdp-muted); }

/* Errores */
.cdp__error { color: var(--cdp-err); font-size: .82rem; font-weight: 600; }
.cdp .has-error input, .cdp .has-error select, .cdp .has-error textarea,
.cdp .has-error .cdp__chip span, .cdp .has-error .cdp__lawyer-box { border-color: var(--cdp-err); }

/* Mensajes */
.cdp__notice, .cdp__result { padding: 16px 18px; border-radius: var(--cdp-radius); margin: 0 0 18px; font-weight: 600; }
.cdp__result { margin: 18px 0 0; }
.cdp__notice--ok, .cdp__result.is-ok { background: #ecf7f0; border: 1px solid #bfe3cd; color: var(--cdp-ok); }
.cdp__notice--err, .cdp__result.is-err { background: #fdf1ef; border: 1px solid #f1c6bf; color: var(--cdp-err); }
.cdp__result .cdp__wa {
	display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; min-height: 46px;
	padding: 10px 18px; background: #1f8f4e; color: #fff !important; border-radius: 8px; text-decoration: none !important;
}
.cdp__form.is-done .cdp__block, .cdp__form.is-done .cdp__footer { display: none; }

.cdp__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 720px) {
	.cdp__footer { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
	.cdp__consent { flex: 1 1 320px; }
	.cdp__submit { width: auto; min-width: 240px; }
	.cdp__privacy { flex-basis: 100%; }
}
@media (max-width: 640px) {
	.cdp__grid, .cdp__lawyers { grid-template-columns: 1fr; gap: 16px; }
	.cdp__chip { flex: 1 1 calc(50% - 8px); }
	.cdp__chip span { width: 100%; height: 100%; justify-content: center; text-align: center; border-radius: 12px; line-height: 1.25; }
	.cdp__form { border-radius: var(--cdp-radius); }
}
@media (prefers-reduced-motion: reduce) {
	.cdp * { transition: none !important; animation-duration: 1.5s !important; }
}
