/* Charolya Submit — brand: kumkum #8C1C2B, halad #D99A1E, shai #2A1A14, kagad #FBF5EA */
.chls {
	--chls-accent: #8C1C2B;
	--chls-accent-dark: #6E1522;
	--chls-gold: #D99A1E;
	--chls-ink: #2A1A14;
	--chls-muted: #5C4334;
	--chls-paper: #FBF5EA;
	--chls-card: #FFFDF8;
	--chls-line: #E4D8C4;
	--chls-radius: 20px;
	--chls-ease: cubic-bezier(.22, .61, .36, 1);
	position: relative;
	max-width: 760px;
	margin: 0 auto;
	padding: clamp(24px, 4vw, 44px);
	background: var(--chls-card);
	border: 1px solid var(--chls-line);
	border-radius: var(--chls-radius);
	box-shadow: 0 1px 0 rgba(42, 26, 20, .04), 0 24px 48px -32px rgba(42, 26, 20, .28);
	color: var(--chls-ink);
	font-family: 'Mukta', system-ui, sans-serif;
	font-size: 17px;
	line-height: 1.6;
	overflow: hidden;
	animation: chls-rise .7s var(--chls-ease) both;
}
/* Four faint ruled lines in the corner: the charoli motif */
.chls::before {
	content: "";
	position: absolute;
	top: 28px;
	right: -24px;
	width: 160px;
	height: 92px;
	background:
		linear-gradient(var(--chls-gold), var(--chls-gold)) 0 0 / 100% 5px no-repeat,
		linear-gradient(var(--chls-accent), var(--chls-accent)) 0 28px / 78% 5px no-repeat,
		linear-gradient(var(--chls-accent), var(--chls-accent)) 0 56px / 90% 5px no-repeat,
		linear-gradient(var(--chls-accent), var(--chls-accent)) 0 84px / 55% 5px no-repeat;
	border-radius: 4px;
	opacity: .08;
	pointer-events: none;
}
.chls *, .chls *::before, .chls *::after { box-sizing: border-box; }
.chls .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.chls-heading, .chls-panel__title {
	margin: 0 0 8px;
	font-family: 'Martel', Georgia, serif;
	font-weight: 800;
	font-size: clamp(26px, 3.2vw, 36px);
	line-height: 1.3;
	color: var(--chls-ink);
}
.chls-panel__title { font-size: clamp(22px, 2.6vw, 28px); }
.chls-intro { margin: 0 0 20px; color: var(--chls-muted); }

/* This month's theme */
.chls-theme {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 0 20px;
	padding: 14px 18px;
	border-radius: 14px;
	background: linear-gradient(135deg, rgba(217, 154, 30, .14), rgba(140, 28, 43, .08));
	border: 1px solid rgba(217, 154, 30, .35);
}
.chls-theme__eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--chls-accent); }
.chls-theme__title { font-family: 'Martel', Georgia, serif; font-weight: 800; font-size: 22px; line-height: 1.35; }

/* Entries meter */
.chls-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 22px; font-size: 15px; color: var(--chls-muted); }
.chls-meter strong { color: var(--chls-ink); font-size: 17px; }
.chls-meter__bar { flex: 1 1 140px; height: 6px; border-radius: 99px; background: var(--chls-line); overflow: hidden; }
.chls-meter__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--chls-gold), var(--chls-accent)); border-radius: inherit; transform-origin: left; animation: chls-grow 1s .3s var(--chls-ease) both; }

/* Fields */
.chls-form { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.chls-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chls-field { display: flex; flex-direction: column; gap: 6px; }
.chls label, .chls legend { font-weight: 600; font-size: 16px; color: var(--chls-ink); }
.chls-req { color: var(--chls-accent); }
.chls-optional { font-weight: 400; color: var(--chls-muted); font-size: 14px; }
.chls-hint { margin: -2px 0 6px; font-size: 14px; color: var(--chls-muted); }
.chls input[type="text"], .chls input[type="email"], .chls input[type="tel"], .chls input[type="password"], .chls select {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	font: inherit;
	color: var(--chls-ink);
	background: #fff;
	border: 1.5px solid var(--chls-line);
	border-radius: 12px;
	transition: border-color .25s var(--chls-ease), box-shadow .25s var(--chls-ease), transform .25s var(--chls-ease);
}
.chls input:hover, .chls select:hover { border-color: #CDBFA8; }
.chls input:focus, .chls select:focus { outline: none; border-color: var(--chls-accent); box-shadow: 0 0 0 4px rgba(140, 28, 43, .12); }
.chls fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.chls legend { padding: 0; margin-bottom: 8px; }

/* The four lines, styled like ruled paper */
.chls-poem { padding: 18px 18px 10px !important; border-radius: 16px !important; background: var(--chls-paper); border: 1px solid var(--chls-line) !important; }
.chls-line { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 10px; }
.chls-line__num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; border-radius: 50%;
	font-family: 'Martel', serif; font-weight: 800; font-size: 15px;
	color: var(--chls-accent); background: rgba(140, 28, 43, .08);
	transition: background .3s var(--chls-ease), color .3s var(--chls-ease), transform .3s var(--chls-ease);
}
.chls-line.is-filled .chls-line__num { background: var(--chls-accent); color: #FBF5EA; transform: scale(1.06); }
.chls .chls-line input {
	font-family: 'Tiro Devanagari Marathi', 'Martel', serif;
	font-size: 19px;
	background: transparent;
	border: 0;
	border-bottom: 1.5px dashed #CDBFA8;
	border-radius: 0;
	padding: 8px 64px 8px 2px;
}
.chls .chls-line input:focus { box-shadow: none; border-bottom: 1.5px solid var(--chls-accent); }
.chls-line__count { position: absolute; right: 2px; bottom: 10px; font-size: 12px; color: var(--chls-muted); font-variant-numeric: tabular-nums; }
.chls-line__count.is-near { color: var(--chls-accent); font-weight: 600; }

/* Mood chips */
.chls-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chls-chip { position: relative; cursor: pointer; }
.chls-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chls-chip span {
	display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px;
	border-radius: 999px; border: 1.5px solid var(--chls-line); background: #fff;
	font-weight: 500; transition: all .25s var(--chls-ease);
}
.chls-chip:hover span { border-color: var(--chls-gold); transform: translateY(-2px); }
.chls-chip input:checked + span { background: var(--chls-accent); border-color: var(--chls-accent); color: #FBF5EA; }
.chls-chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(140, 28, 43, .18); }
.chls-chip input:disabled + span { opacity: .45; cursor: not-allowed; transform: none; }

/* Consent */
.chls-consent label, .chls-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; color: var(--chls-muted); line-height: 1.55; }
.chls-consent { padding: 14px 16px; border-radius: 12px; background: rgba(42, 26, 20, .03); border: 1px solid var(--chls-line); }
.chls input[type="checkbox"], .chls input[type="radio"] { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 3px; accent-color: var(--chls-accent); }
.chls a { color: var(--chls-accent); text-underline-offset: 3px; }
.chls a:hover { color: var(--chls-accent-dark); }

/* Buttons */
.chls-btn {
	position: relative;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 50px; padding: 12px 30px;
	font: 600 18px/1.2 'Mukta', sans-serif;
	color: #FBF5EA !important; text-decoration: none;
	background: var(--chls-accent);
	border: 0; border-radius: 999px; cursor: pointer; overflow: hidden;
	box-shadow: 0 10px 22px -12px rgba(140, 28, 43, .7);
	transition: transform .3s var(--chls-ease), box-shadow .3s var(--chls-ease), background .3s var(--chls-ease);
}
.chls-btn::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 233, 180, .35) 50%, transparent 70%);
	transform: translateX(-120%); transition: transform .7s var(--chls-ease);
}
.chls-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -14px rgba(140, 28, 43, .8); background: var(--chls-accent-dark); }
.chls-btn:hover::after { transform: translateX(120%); }
.chls-btn:focus-visible { outline: 3px solid var(--chls-gold); outline-offset: 3px; }
.chls-btn--ghost { color: var(--chls-accent) !important; background: transparent; border: 1.5px solid var(--chls-accent); box-shadow: none; }
.chls-btn--ghost:hover { background: rgba(140, 28, 43, .06); }
.chls-btn--submit { align-self: flex-start; }
.chls-btn.is-busy { pointer-events: none; opacity: .75; }

/* Notices */
.chls-notice { margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; font-size: 16px; animation: chls-rise .5s var(--chls-ease) both; }
.chls-notice--success { background: #EAF4EA; color: #1E5B2A; border: 1px solid #B9DDBE; }
.chls-notice--error { background: #FBEAEA; color: #7A1620; border: 1px solid #EDC1C5; }
.chls-notice--info { background: #FFF6E3; color: #6B4A0E; border: 1px solid #F0D9A4; }

.chls-gate { padding: 22px; border-radius: 16px; background: var(--chls-paper); border: 1px dashed #CDBFA8; text-align: center; }
.chls-gate p { margin: 0 0 14px; }
.chls-gate__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.chls-welcome { text-align: center; }
.chls-welcome__hi { font-size: 20px; margin: 0 0 16px; }

/* My entries */
.chls-entries { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--chls-line); }
.chls-entries h3 { margin: 0 0 12px; font-family: 'Martel', serif; font-weight: 800; font-size: 22px; }
.chls-entries ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chls-entry { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--chls-line); transition: transform .25s var(--chls-ease), border-color .25s var(--chls-ease); }
.chls-entry:hover { transform: translateX(4px); border-color: var(--chls-gold); }
.chls-entry__main { display: flex; flex-direction: column; min-width: 0; }
.chls-entry__main span { font-family: 'Tiro Devanagari Marathi', serif; color: var(--chls-muted); font-size: 15px; }
.chls-entry__meta { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--chls-muted); }
.chls-badge { padding: 3px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.chls-badge--pending { background: #FFF1D6; color: #7A5208; }
.chls-badge--publish { background: #E3F1E5; color: #1E5B2A; }
.chls-badge--chls_rejected { background: #F7E2E4; color: #7A1620; }
.chls-badge--winner { background: var(--chls-gold); color: var(--chls-ink); }

/* Tabs */
.chls-tabs { display: flex; gap: 6px; padding: 5px; margin: 0 0 22px; border-radius: 999px; background: var(--chls-paper); border: 1px solid var(--chls-line); }
.chls-tab { flex: 1; min-height: 46px; border: 0; border-radius: 999px; background: transparent; font: 600 17px 'Mukta', sans-serif; color: var(--chls-muted); cursor: pointer; transition: all .3s var(--chls-ease); }
.chls-tab:hover { color: var(--chls-ink); }
.chls-tab[aria-selected="true"] { background: var(--chls-accent); color: #FBF5EA; box-shadow: 0 8px 18px -10px rgba(140, 28, 43, .7); }
.chls-tab:focus-visible { outline: 3px solid var(--chls-gold); outline-offset: 2px; }
.chls-panel { animation: chls-rise .45s var(--chls-ease) both; }
.chls-split { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; }
.chls-age { display: flex; flex-direction: column; gap: 8px; }

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

@keyframes chls-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes chls-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 640px) {
	.chls { padding: 22px 18px; border-radius: 16px; }
	.chls-row { grid-template-columns: minmax(0, 1fr); }
	.chls-btn--submit { align-self: stretch; }
	.chls .chls-line input { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
	.chls, .chls *, .chls *::after { animation: none !important; transition: none !important; }
}
