/* FCE Europass CV Builder - mobile first. Palette: sky blue + white, gold accent. */
.fce {
	--navy: #0284c7;
	--blue: #0ea5e9;
	--sky: #38bdf8;
	--gold: #ffcc00;
	--gold-dark: #e0b000;
	--mist: #f0f9ff;
	--line: #bae6fd;
	--ink: #1e293b;
	--muted: #475569;
	--ok: #0a7a4b;
	--bad: #b3261e;
	--radius: 14px;
	max-width: 760px;
	margin: 0 auto;
	padding: 0 0 48px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Sinhala", "Noto Sans Tamil", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--ink);
	box-sizing: border-box;
}
.fce *, .fce *::before, .fce *::after { box-sizing: border-box; }
.fce [hidden] { display: none !important; }
.fce-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fce-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Hero */
.fce-hero {
	position: relative; overflow: hidden; margin: 0 0 18px; padding: 28px 20px 22px;
	color: #fff; border-radius: 0 0 var(--radius) var(--radius);
	background:
		radial-gradient(circle at 92% 8%, rgba(255, 204, 0, .35) 0, rgba(255, 204, 0, 0) 38%),
		linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
}
.fce-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--gold); }
.fce-hero__eyebrow { margin: 0 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.fce-hero h1 { margin: 0 0 8px; font-size: 1.7rem; line-height: 1.2; color: #fff; }
.fce-hero p { margin: 0; color: #ffffff; }

.fce-steps { display: flex; gap: 8px; margin: 18px 0 4px; padding: 0; list-style: none; }
.fce-steps li { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; white-space: nowrap; font-size: .82rem; font-weight: 600; color: #e0f2fe; background: rgba(255, 255, 255, .08); border-radius: 999px; }
.fce-steps li span { flex: none; display: grid; place-items: center; width: 24px; height: 24px; font-size: .8rem; color: #fff; background: rgba(255, 255, 255, .18); border-radius: 50%; }
.fce-steps li.is-current { color: var(--navy); background: var(--gold); }
.fce-steps li.is-current span { color: var(--gold); background: var(--navy); }
.fce-steps li.is-done span { color: var(--navy); background: #8ee0b3; }

/* Alerts */
.fce-alert { margin: 0 0 16px; padding: 14px 16px; color: #5c1410; background: #fdecea; border: 2px solid var(--bad); border-radius: 12px; }
.fce-alert ul { margin: 8px 0 0 18px; padding: 0; }
.fce-alert li { margin: 2px 0; }

/* Form and numbered sections (section number . field number) */
.fce-form { counter-reset: sec; padding: 0; }
.fce-sec {
	counter-increment: sec; counter-reset: fld; margin: 0 0 18px; padding: 20px 16px 8px;
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: 0 6px 20px rgba(14, 165, 233, .12);
}
.fce-sec__title { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; font-size: 1.2rem; line-height: 1.25; color: var(--navy); }
.fce-sec__title::before {
	content: counter(sec); flex: none; display: grid; place-items: center; width: 38px; height: 38px;
	font-size: 1.05rem; font-weight: 800; color: var(--navy); background: var(--gold); border-radius: 50%;
	box-shadow: 0 0 0 4px rgba(255, 204, 0, .3);
}
.fce-sec__intro { margin: 0 0 16px; color: var(--muted); font-size: .95rem; }
.fce-sec__title + .fce-field, .fce-sec__title + .fce-repeat, .fce-sec__title + fieldset { margin-top: 16px; }

.fce-field { counter-increment: fld; margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.fce-lbl { display: block; margin: 0 0 6px; padding: 0; font-weight: 700; color: var(--navy); }
.fce-lbl::before {
	content: counter(sec) "." counter(fld); display: inline-block; min-width: 2.6em; margin-right: 8px; padding: 1px 7px;
	font-size: .78rem; font-weight: 700; text-align: center; color: var(--blue); background: var(--mist); border-radius: 999px;
}
.fce-req { color: var(--bad); }
.fce-hint { margin: 6px 0 0; font-size: .875rem; color: var(--muted); }

/* Single-line bordered inputs */
.fce input[type="text"], .fce input[type="tel"], .fce input[type="email"], .fce input[type="date"],
.fce select, .fce textarea {
	display: block; width: 100%; min-height: 50px; margin: 0; padding: 11px 14px; font: inherit; color: var(--ink);
	background: #fff; border: 2px solid var(--line); border-radius: 10px; box-shadow: none;
	-webkit-appearance: none; appearance: none;
}
.fce select {
	padding-right: 38px;
	background-image: linear-gradient(45deg, transparent 50%, var(--blue) 50%), linear-gradient(135deg, var(--blue) 50%, transparent 50%);
	background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat;
}
.fce textarea { min-height: 110px; resize: vertical; }
.fce input:focus, .fce select:focus, .fce textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(47, 111, 237, .2); }
.fce input:disabled { background: var(--mist); color: var(--muted); }
.fce-field.is-invalid input, .fce-field.is-invalid select, .fce-field.is-invalid textarea { border-color: var(--bad); }
.fce-err { margin: 6px 0 0; font-size: .9rem; font-weight: 600; color: var(--bad); }

/* Radio choices and checkboxes */
.fce-choices { display: grid; gap: 10px; }
.fce-choice { position: relative; display: block; cursor: pointer; }
.fce-choice input { position: absolute; opacity: 0; }
.fce-choice span { display: block; padding: 13px 16px; font-weight: 600; background: #fff; border: 2px solid var(--line); border-radius: 10px; }
.fce-choice input:checked + span { color: var(--navy); background: #fff7cc; border-color: var(--gold-dark); }
.fce-choice input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
.fce-check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; font-size: .95rem; cursor: pointer; }
.fce-check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--blue); }

/* Repeatable entries */
.fce-entries { display: grid; gap: 16px; margin-bottom: 14px; counter-reset: ent; }
.fce-entry { padding: 16px 14px 2px; background: var(--mist); border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: 12px; }
.fce-entry__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fce-entry__title { font-weight: 800; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; }
.fce-remove { min-height: 40px; padding: 0 12px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--bad); background: transparent; border: 0; cursor: pointer; text-decoration: underline; }
.fce-entry .fce-lbl::before { background: #fff; }

/* Buttons */
.fce-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px;
	font: inherit; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; border: 2px solid transparent; border-radius: 12px;
}
.fce-btn--gold { color: var(--navy); background: var(--gold); box-shadow: 0 4px 0 var(--gold-dark); }
.fce-btn--gold:hover { background: #ffd83d; }
.fce-btn--gold:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--gold-dark); }
.fce-btn--ghost { color: var(--blue); background: #fff; border-color: var(--blue); }
.fce-btn--ghost:hover { background: var(--mist); }
.fce-btn[disabled] { opacity: .55; cursor: not-allowed; }
.fce-sr:focus-visible + .fce-btn, .fce-btn:focus-visible, .fce-remove:focus-visible, .fce-check input:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.fce-add { width: 100%; }
.fce-actions { padding: 6px 0 0; }
.fce-actions .fce-btn { width: 100%; }
.fce-actions--split { display: grid; gap: 12px; }

/* Photo */
.fce-photo__row { display: flex; gap: 16px; align-items: flex-start; }
.fce-photo__frame {
	position: relative; flex: none; width: 112px; aspect-ratio: 35 / 45; display: grid; place-items: center; overflow: hidden;
	font-size: .8rem; font-weight: 700; color: var(--muted); text-align: center; background: #fff; border: 2px dashed var(--blue); border-radius: 8px;
}
.fce-photo__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fce-photo__side { min-width: 0; }
.fce-photo__side .fce-btn, .fce-doc .fce-btn { white-space: nowrap; padding: 0 18px; }
.fce-photo__msg { margin: 6px 0 0; font-size: .9rem; font-weight: 600; }
.fce-photo__msg.is-ok { color: var(--ok); }
.fce-photo__msg.is-error { color: var(--bad); }

/* Documents */
.fce-doc { padding: 14px; background: var(--mist); border: 1px solid var(--line); border-radius: 12px; }
.fce-doc .fce-lbl::before { background: #fff; }
.fce-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.fce-files li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.fce-files__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fce-files__size { flex: none; font-size: .85rem; color: var(--muted); }

/* Preview */
.fce-preview, .fce-done { margin: 0; }
.fce-preview__title { margin: 4px 0 4px; font-size: 1.4rem; color: var(--navy); }
.fce-cv { margin: 14px 0 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(14, 165, 233, .15); }
.fce-cv__head { display: flex; justify-content: space-between; gap: 14px; padding: 20px 16px; color: #fff; background: linear-gradient(135deg, var(--navy), var(--blue)); border-bottom: 5px solid var(--gold); }
.fce-cv__headtxt { min-width: 0; }
.fce-cv__eyebrow { display: block; margin-bottom: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; color: var(--gold); }
.fce-cv__name { margin: 0 0 6px; font-size: 1.35rem; line-height: 1.2; color: #fff; overflow-wrap: anywhere; }
.fce-cv__pos { color: #ffffff; }
.fce-cv__photo { flex: none; width: 92px; aspect-ratio: 35 / 45; overflow: hidden; background: #fff; border: 3px solid #fff; border-radius: 4px; }
.fce-cv__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fce-cv__sec { padding: 14px 16px 6px; }
.fce-cv__h { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding-bottom: 8px; font-size: .95rem; letter-spacing: .05em; text-transform: uppercase; color: var(--navy); border-bottom: 2px solid var(--blue); }
.fce-cv__h::before { content: ""; width: 6px; height: 18px; background: var(--gold); border-radius: 2px; }
.fce-cv__kv { display: grid; gap: 2px; margin-bottom: 10px; }
.fce-cv__k { font-size: .82rem; font-weight: 700; color: var(--blue); }
.fce-cv__v, .fce-cv__text { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.fce-cv__entry { display: grid; gap: 4px; margin-bottom: 14px; }
.fce-cv__date { font-size: .82rem; font-weight: 800; color: var(--blue); }
.fce-cv__body strong { display: block; color: var(--navy); text-transform: uppercase; font-size: .92rem; }
.fce-cv__body em { display: block; color: var(--muted); }
.fce-cv__body p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }

.fce-consent { margin: 0 0 18px; padding: 16px; background: #fff8d6; border: 2px solid var(--gold); border-radius: var(--radius); }
.fce-check--big { margin: 0; font-size: .98rem; }
.fce-check--big input { width: 26px; height: 26px; }

/* Done */
.fce-done { padding: 30px 20px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(14, 165, 233, .15); }
.fce-done:focus { outline: none; }
.fce-done__tick { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 12px; font-size: 2.2rem; color: #fff; background: var(--ok); border-radius: 50%; }
.fce-done h2 { margin: 0 0 8px; color: var(--navy); }
.fce-done__label { margin: 18px 0 4px; font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fce-done__ref { margin: 0 0 14px; padding: 14px 8px; font-size: 1.35rem; font-weight: 800; letter-spacing: .03em; color: var(--navy); background: var(--gold); border-radius: 12px; overflow-wrap: anywhere; user-select: all; }

@media (min-width: 640px) {
	.fce-hero { border-radius: var(--radius); margin-top: 12px; }
	.fce-hero h1 { font-size: 2.1rem; }
	.fce-sec { padding: 24px 28px 10px; }
	.fce-sec__intro { margin-left: 50px; }
	.fce-choices { grid-template-columns: 1fr 1fr; }
	.fce-actions .fce-btn { width: auto; min-width: 240px; }
	.fce-actions--split { grid-template-columns: 1fr 1fr; }
	.fce-actions--split .fce-btn { width: 100%; }
	.fce-cv__kv { grid-template-columns: 200px 1fr; gap: 12px; }
	.fce-cv__entry { grid-template-columns: 150px 1fr; gap: 14px; }
	.fce-add { width: auto; }
	.fce-photo__frame { width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
	.fce * { transition: none !important; scroll-behavior: auto !important; }
}
