/* One Voice — petition page (/submit/). Loaded after main.css. */

.submit-page { position: relative; }

/* ---------- Hero ---------- */
.submit-hero {
	position: relative;
	overflow: clip;
	padding-top: calc(var(--header-h) + clamp(32px, 6vw, 72px));
	padding-bottom: clamp(20px, 4vw, 40px);
	text-align: center;
}
.submit-hero__inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.submit-hero__title {
	margin: 20px 0 0;
	font-size: clamp(38px, 6vw, 68px);
	font-weight: 700;
	line-height: 1.08;
	color: var(--ink);
	text-wrap: balance;
}
:lang(en) .submit-hero__title, [dir="ltr"] .submit-hero__title { letter-spacing: -.045em; }
[dir="rtl"] .submit-hero__title { line-height: 1.25; letter-spacing: 0; }
.submit-hero__lead { max-width: 56ch; margin: 16px auto 0; text-wrap: pretty; }

/* ---------- Body ---------- */
.submit-body { padding-bottom: clamp(56px, 9vw, 120px); }
.required-note { margin: 0; font-size: 14px; color: var(--muted); }

.form-alert {
	display: flex; gap: 14px; align-items: flex-start;
	margin-bottom: 20px; padding: 18px 20px;
	background: var(--red-50); color: var(--red-ink);
	border-radius: var(--r); box-shadow: 0 0 0 1px var(--red-100);
}
.form-alert:focus { outline: none; box-shadow: 0 0 0 1px var(--red), 0 0 0 5px rgba(200,0,0,.14); }
.form-alert svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.form-alert p { margin: 4px 0 0; font-size: 15px; }

/* Friendly (duplicate) notice: a thank-you, not an alarm */
.form-thanks {
	display: flex; gap: 14px; align-items: flex-start;
	margin-bottom: 20px; padding: 18px 20px;
	background: var(--bg-soft); color: var(--ink);
	border-radius: var(--r); box-shadow: 0 0 0 1px var(--line);
}
.form-thanks__icon svg { width: 26px; height: 26px; color: var(--red); flex: none; }
.form-thanks strong { display: block; font-size: 17px; }
.form-thanks p { margin: 4px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }

/* ---------- Card ---------- */
.form-card {
	min-width: 0; margin: 0 0 20px; padding: 22px 18px;
	background: var(--bg); border: 0; border-radius: var(--r-lg);
	box-shadow: 0 0 0 1px var(--line-soft), var(--sh-1);
}
@media (min-width: 640px) { .form-card { padding: 30px 34px; } }
.petition-card { display: flex; flex-direction: column; gap: 22px; }
.petition-card > * { min-width: 0; }

/* ---------- Tabs (segmented control) ---------- */
.tabs {
	display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px;
	padding: 4px; border-radius: var(--r);
	background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line-soft);
}
@media (min-width: 560px) { .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tab {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	min-height: 56px; padding: 10px 14px; box-sizing: border-box;
	border-radius: calc(var(--r) - 4px);
	text-align: center; text-decoration: none; color: var(--muted);
	font-size: 15px; font-weight: 600; line-height: 1.35;
	transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active {
	background: #fff; color: var(--red-ink);
	box-shadow: 0 0 0 1px var(--red-100), 0 2px 8px rgba(15,15,16,.08);
}
.tab:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.tab__sub { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.tab.is-active .tab__sub { color: var(--red-ink); opacity: .8; }

.tab-panel[hidden] { display: none; }

/* ---------- Grid & fields ---------- */
.grid-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; } }

.field { min-width: 0; }
.field label, .field .label {
	display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
	margin-bottom: 8px; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
}
.req { color: var(--red); font-weight: 700; }
.req[hidden] { display: none; }
.opt {
	margin-inline-start: auto; padding: 1px 8px; border-radius: var(--pill);
	font-size: 11.5px; font-weight: 500; color: var(--subtle); background: var(--bg-soft);
}
.field-help { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
	display: block; width: 100%; box-sizing: border-box;
	font: inherit; font-size: 16px; color: var(--ink);
	background-color: #fff; border: 1px solid #DEDEE2; border-radius: 14px;
	box-shadow: inset 0 1px 2px rgba(15,15,16,.05);
	transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
	-webkit-appearance: none; appearance: none;
}
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select {
	height: 52px; padding-inline: 16px;
}
.field input::placeholder, .field textarea::placeholder { color: var(--subtle); opacity: 1; }
.field input[dir="ltr"]:lang(fa), [dir="rtl"] .field input[dir="ltr"] { text-align: start; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #BDBDC4; }
.field input:focus, .field select:focus, .field textarea:focus {
	outline: none; border-color: var(--red);
	box-shadow: inset 0 1px 2px rgba(15,15,16,.03), 0 0 0 4px rgba(200,0,0,.12);
}
.field select {
	cursor: pointer; padding-inline-end: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-size: 16px;
	background-position: right 16px center;
}
[dir="rtl"] .field select { background-position: left 16px center; }
.field textarea { min-height: 130px; padding: 14px 16px; line-height: 1.7; resize: vertical; }

/* error states */
.field.has-error input, .field.has-error select, .field.has-error textarea,
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] {
	border-color: var(--red); background-color: var(--red-50);
}
@supports selector(:user-invalid) {
	.field input:user-invalid, .field select:user-invalid, .field textarea:user-invalid {
		border-color: var(--red); background-color: var(--red-50);
	}
}
.field-error { margin: 8px 0 0; font-size: 13.5px; font-weight: 500; color: var(--red-ink); }
.field-error[hidden] { display: none; }

.field-foot { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; }
.counter {
	flex: none; margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--subtle);
	font-variant-numeric: tabular-nums; transition: color .25s var(--ease);
}
.counter.is-low { color: var(--red); }

/* ---------- Checkboxes ---------- */
.checks { display: grid; gap: 4px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.check-row { padding: 8px 0; }
.check-row[hidden] { display: none; }
.check { position: relative; display: flex; align-items: flex-start; gap: 14px; min-height: 44px; cursor: pointer; }
.check input {
	position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer;
}
.check__box {
	position: relative; flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px;
	border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 1.5px #C9C9CF; color: #fff;
	transition: background-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease-spring);
}
.check__box svg { width: 14px; height: 14px; transform: scale(0); transition: transform .3s var(--ease-spring); }
.check:hover .check__box { box-shadow: inset 0 0 0 1.5px #9A9AA2; }
.check input:checked ~ .check__box {
	background: linear-gradient(180deg, #E22A2A 0%, var(--red) 55%, var(--red-600) 100%);
	box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 3px 8px rgba(200,0,0,.28);
}
.check input:checked ~ .check__box svg { transform: scale(1); }
.check input:active ~ .check__box { transform: scale(.92); }
.check input:focus-visible ~ .check__box { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--red); }
.check input[aria-invalid="true"] ~ .check__box { box-shadow: inset 0 0 0 1.5px var(--red), 0 0 0 4px rgba(200,0,0,.12); }
.check__text { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.check__tag { font-size: 12.5px; font-weight: 500; color: var(--subtle); white-space: nowrap; }
.check__tag.is-required { color: var(--red-ink); font-weight: 600; }
.check__link { color: var(--red-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.check__link:hover { color: var(--red); }
.check-row .field-error { margin-inline-start: 38px; }

/* ---------- Privacy box ---------- */
.privacy-box {
	padding: 16px 18px; border-radius: var(--r);
	background: var(--bg-soft); box-shadow: 0 0 0 1px var(--line-soft);
	font-size: 13.5px; line-height: 1.7; color: var(--muted);
}
.privacy-box p { margin: 0 0 8px; }
.privacy-box__title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; font-weight: 650; color: var(--ink); }
.privacy-box__title svg { width: 16px; height: 16px; color: var(--red); flex: none; }

/* ---------- Submit ---------- */
.submit-area { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.submit-btn { width: 100%; max-width: 440px; min-height: 52px; }
.submit-btn .btn__icon { width: 20px; height: 20px; }
[dir="rtl"] .submit-btn .btn__icon { transform: scaleX(-1); }
.submit-btn[disabled] { cursor: progress; }

/* ---------- Thank-you ---------- */
.thanks-card {
	display: flex; flex-direction: column; align-items: center; text-align: center;
	margin-top: 4px; padding: clamp(32px, 6vw, 64px) clamp(22px, 5vw, 56px);
	background: #fff; border-radius: var(--r-xl); box-shadow: 0 0 0 1px var(--line-soft), var(--sh-3);
	animation: ov-pop .6s var(--ease-spring) both;
}
.thanks-card__medal {
	display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: #fff;
	background: linear-gradient(180deg, #F04040 0%, var(--red) 52%, var(--red-700) 100%);
	box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset 0 -3px 6px rgba(0,0,0,.15), 0 14px 34px rgba(200,0,0,.35);
}
.thanks-card__check { width: 40px; height: 40px; }
.thanks-card__title { margin: 26px 0 0; font-size: clamp(30px, 5vw, 48px); font-weight: 700; line-height: 1.2; color: var(--ink); text-wrap: balance; }
:lang(en) .thanks-card__title { letter-spacing: -.04em; }
.thanks-card__share-label { margin: 28px 0 14px; font-size: 15.5px; color: var(--ink-2); }
.thanks-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.check-mail { display: flex; gap: 14px; align-items: flex-start; text-align: start; margin: 22px auto 0; max-width: 520px; padding: 16px 20px; border-radius: var(--r); background: var(--red-50); box-shadow: 0 0 0 1px var(--red-100); }
.check-mail__icon svg { width: 26px; height: 26px; color: var(--red); }
.check-mail p { margin: 0; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.share-row__btn { min-height: 46px; gap: 8px; }
.share-row__icon { width: 18px; height: 18px; flex: none; }
.copy-fallback { position: absolute; }
@keyframes ov-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Messages of support ---------- */
.support-wall { margin-top: clamp(40px, 7vw, 72px); }
.support-wall__title { margin: 0 0 20px; font-size: clamp(22px, 3.2vw, 30px); font-weight: 700; color: var(--ink); text-align: center; }
:lang(en) .support-wall__title { letter-spacing: -.03em; }
.support-wall__list { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .support-wall__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- v2: signed-in bar ---------- */
.signed-bar { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; border-radius: var(--pill); background: var(--bg-soft); box-shadow: 0 0 0 1px var(--line-soft); font-size: 14.5px; color: var(--muted); }
.signed-bar svg { width: 18px; height: 18px; flex: none; color: var(--red); }
.signed-bar span { min-width: 0; overflow-wrap: anywhere; }
.signed-bar a { color: var(--red-ink); font-weight: 600; }
.field input[readonly] { background: var(--bg-soft); color: var(--muted); cursor: not-allowed; }

@media (max-width: 420px) {
	.form-card { padding: 18px 14px; border-radius: var(--r); }
	.field-foot { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.form-card *, .thanks-card { animation: none !important; transition: none !important; }
}
