/* Calculadora de Embarazo v2 – lilac theme */
.ce-calc {
	--ce-bg: #f6e9f2;
	--ce-bg-2: #fbf4f8;
	--ce-border: #e2c4dc;
	--ce-accent: #c58ab9;
	--ce-btn: #a2559a;
	--ce-btn-hover: #8c4785;
	--ce-ink: #3c5a6e;
	--ce-text: #45505a;
	--ce-muted: #66707a;
	--ce-line: #ead6e5;
	max-width: 860px;
	margin: 1.5em auto;
	color: var(--ce-text);
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}
.ce-calc *, .ce-calc *::before, .ce-calc *::after { box-sizing: border-box; }
.ce-calc [hidden] { display: none !important; }

.ce-card {
	position: relative;
	background: var(--ce-bg);
	border: 3px solid var(--ce-border);
	border-radius: 22px;
	padding: 28px 32px 30px;
	overflow: hidden;
}

/* Header + illustration */
.ce-head { display: flex; align-items: center; gap: 16px; }
.ce-head-text { flex: 1 1 auto; min-width: 0; }
.ce-kicker { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--ce-btn); letter-spacing: .2px; }
.ce-title { margin: 0; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; font-weight: 800; color: var(--ce-ink); }
.ce-sub { margin: 8px 0 0; color: var(--ce-muted); font-size: 15px; max-width: 420px; }
.ce-art { flex: 0 0 210px; width: 210px; margin: -18px -12px -26px 0; }
.ce-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.ce-float { animation: ce-float 4.5s ease-in-out infinite; transform-origin: center; }
.ce-star { animation: ce-twinkle 2.6s ease-in-out infinite; }
.ce-s2 { animation-delay: .8s; }
.ce-s3 { animation-delay: 1.6s; }
.ce-z text { animation: ce-z 3s ease-in-out infinite; }
.ce-z .ce-z2 { animation-delay: 1s; }
@keyframes ce-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes ce-twinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes ce-z { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -10px); } }

/* Form */
.ce-form { margin-top: 22px; position: relative; z-index: 1; }
.ce-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; }
.ce-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 190px; min-width: 0; margin: 0; }
.ce-field-modo { flex: 1 1 200px; }
.ce-field-sm { flex: 0 1 120px; }
.ce-field-xs { flex: 0 1 92px; }
.ce-field > span { font-size: 13px; font-weight: 700; color: var(--ce-ink); }
.ce-field input, .ce-field select {
	width: 100%;
	height: 50px;
	padding: 0 12px;
	border: 2px solid var(--ce-border);
	border-radius: 10px;
	background: #fff;
	color: var(--ce-text);
	font: inherit;
	font-size: 16px;
	transition: border-color .2s, box-shadow .2s;
	-webkit-appearance: none;
	appearance: none;
}
.ce-field select {
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%233c5a6e' d='M7 9l5 5 5-5z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 20px;
}
.ce-field input:focus, .ce-field select:focus { outline: none; border-color: var(--ce-btn); box-shadow: 0 0 0 4px rgba(162, 85, 154, .18); }
.ce-btn {
	flex: 0 0 auto;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 52px; padding: 0 26px;
	border: 0; border-radius: 999px;
	background: var(--ce-btn); color: #fff;
	font: inherit; font-size: 17px; font-weight: 800; letter-spacing: .3px;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(162, 85, 154, .28);
	transition: transform .15s, background .2s, box-shadow .2s;
}
.ce-btn:hover { background: var(--ce-btn-hover); transform: translateY(-1px); }
.ce-btn:active { transform: translateY(1px); }
.ce-btn:focus-visible, .ce-actions button:focus-visible { outline: 3px solid var(--ce-ink); outline-offset: 2px; }
.ce-hint { margin: 14px 0 0; font-size: 13px; color: var(--ce-muted); padding-top: 14px; border-top: 2px solid var(--ce-line); max-width: 460px; }
.ce-error { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: #fff; border-left: 4px solid #b3261e; color: #8c1d18; font-weight: 600; font-size: 14px; }
.ce-shake { animation: ce-shake .35s; }
@keyframes ce-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* Result */
.ce-result { margin-top: 24px; padding-top: 24px; border-top: 2px solid var(--ce-line); }
.ce-in { animation: ce-in .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ce-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ce-res-top { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ce-ring { position: relative; width: 150px; height: 150px; flex: 0 0 150px; }
.ce-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ce-ring circle { fill: none; stroke-width: 11; }
.ce-ring-bg { stroke: #fff; }
.ce-ring-fg { stroke: var(--ce-btn); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 1.3s cubic-bezier(.2, .8, .2, 1); }
.ce-ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ce-ring-w { font-size: 42px; font-weight: 800; color: var(--ce-ink); }
.ce-ring-in span { font-size: 13px; font-weight: 700; color: var(--ce-muted); }
.ce-ring-d { font-size: 13px; color: var(--ce-btn); font-weight: 700; margin-top: 2px; }
.ce-res-main { flex: 1 1 260px; min-width: 0; }
.ce-label { display: block; font-size: 13px; font-weight: 700; color: var(--ce-muted); text-transform: uppercase; letter-spacing: .6px; }
.ce-fpp { display: block; margin: 4px 0 6px; font-size: clamp(22px, 3.4vw, 30px); line-height: 1.2; font-weight: 800; color: var(--ce-ink); }
.ce-fpp::first-letter { text-transform: uppercase; }
.ce-count { display: block; font-size: 15px; }
.ce-count b { color: var(--ce-btn); font-size: 18px; }
.ce-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ce-chip { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--ce-border); font-size: 13px; }
.ce-chip b { color: var(--ce-ink); }

.ce-track { margin: 24px 0 6px; }
.ce-track-bar { position: relative; height: 12px; border-radius: 999px; background: linear-gradient(90deg, #fff 0 32.5%, #f3e2ee 32.5% 67.5%, #fff 67.5%); border: 1px solid var(--ce-border); }
.ce-track-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: var(--ce-accent); transition: width 1.3s cubic-bezier(.2, .8, .2, 1); }
.ce-track-dot { position: absolute; top: 50%; left: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--ce-btn); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(60, 90, 110, .25); transition: left 1.3s cubic-bezier(.2, .8, .2, 1); }
.ce-track-labels { display: grid; grid-template-columns: 32.5fr 35fr 32.5fr; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--ce-muted); text-align: center; }

.ce-baby { display: flex; align-items: center; gap: 14px; margin: 18px 0; padding: 14px 18px; border-radius: 16px; background: #fff; }
.ce-baby-emoji { font-size: 38px; line-height: 1; animation: ce-pop .6s .4s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes ce-pop { from { transform: scale(0); } to { transform: scale(1); } }
.ce-baby-text { margin: 0; font-size: 15px; }
.ce-baby-text strong { color: var(--ce-ink); }

.ce-h { margin: 22px 0 10px; font-size: 18px; font-weight: 800; color: var(--ce-ink); }
.ce-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.ce-timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 14px 26px; font-size: 15px; animation: ce-in .45s cubic-bezier(.2, .8, .2, 1) both; }
.ce-timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--ce-btn); }
.ce-timeline li::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--ce-border); }
.ce-timeline li:last-child::after { display: none; }
.ce-timeline li.is-past::before { background: var(--ce-accent); border-color: var(--ce-accent); }
.ce-timeline li.is-past { color: var(--ce-muted); }
.ce-timeline li.is-next::before { box-shadow: 0 0 0 5px rgba(162, 85, 154, .2); }
.ce-tl-date { flex: 0 0 96px; font-weight: 800; color: var(--ce-ink); }
.ce-timeline li.is-past .ce-tl-date { color: var(--ce-muted); }

.ce-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ce-actions button { min-height: 44px; padding: 0 18px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .2s, color .2s; }
.ce-again { background: #fff; color: var(--ce-btn); border: 2px solid var(--ce-btn); }
.ce-again:hover { background: var(--ce-btn); color: #fff; }
.ce-pdf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--ce-btn); color: #fff; border: 2px solid var(--ce-btn); }
.ce-pdf:hover { background: var(--ce-btn-hover); border-color: var(--ce-btn-hover); }
.ce-pdf:disabled { opacity: .75; cursor: progress; }
.ce-share { background: var(--ce-ink); color: #fff; border: 2px solid var(--ce-ink); }
.ce-share:hover { background: #2d4555; }
.ce-note { margin: 18px 0 0; font-size: 13px; color: var(--ce-muted); }

/* Mobile */
@media (max-width: 640px) {
	.ce-card { padding: 20px 18px 22px; border-radius: 18px; }
	.ce-head { flex-direction: column-reverse; align-items: stretch; text-align: center; gap: 0; }
	.ce-art { width: 150px; flex-basis: auto; margin: -8px auto 0; }
	.ce-sub { margin-left: auto; margin-right: auto; }
	.ce-field, .ce-field-modo { flex: 1 1 100%; }
	.ce-field-sm, .ce-field-xs { flex: 1 1 calc(50% - 7px); }
	.ce-btn { width: 100%; }
	.ce-res-top { flex-direction: column; text-align: center; gap: 14px; }
	.ce-res-main { flex-basis: auto; }
	.ce-chips { justify-content: center; }
	.ce-track-labels { font-size: 11px; }
	.ce-actions button { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.ce-calc *, .ce-calc *::before, .ce-calc *::after { animation: none !important; transition: none !important; }
}
