/**
 * Create form extras: couple-order switch, wedding photos, bank account.
 * Markup: inc/create-couple-order.php, inc/create-photos.php, inc/create-bank.php.
 * Colors come from the parent's tokens (--accent, --ink, --line…), set by the Customizer.
 */

.create-form {
	--cx-accent-soft: color-mix(in oklch, var(--accent) 9%, #fff);
	--cx-accent-line: color-mix(in oklch, var(--accent) 35%, #fff);
	--cx-danger: #c0392b;
	--cx-ease: cubic-bezier(.2, .8, .2, 1);
	--cx-fast: .18s;
}

/* Couple order switch ------------------------------------------------------------- */

.create-order {
	display: grid;
	gap: 8px;
	min-width: 0;
	margin: 0 0 18px;
	padding: 0;
	border: 0;
}
.create-order__legend {
	margin-bottom: 8px;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--accent);
}
.create-order__switch {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	padding: 4px;
	background: var(--tint);
	border: 1px solid var(--line);
	border-radius: 14px;
}
.create-order__opt {
	position: relative;
	display: block;
	min-width: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.create-order__opt input {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: pointer;
}
.create-order__opt span {
	display: grid;
	gap: 1px;
	min-height: 44px;
	padding: 8px 12px;
	border-radius: 10px;
	text-align: center;
	color: var(--muted);
	transition: background-color var(--cx-fast) ease, color var(--cx-fast) ease, box-shadow var(--cx-fast) ease, transform var(--cx-fast) var(--cx-ease);
}
.create-order__opt b { font-size: 14.5px; font-weight: 600; }
.create-order__opt small { font-size: 12px; }
.create-order__opt:hover span { color: var(--ink); }
.create-order__opt input:checked + span {
	background: #fff;
	color: var(--accent);
	box-shadow: 0 1px 0 var(--cx-accent-line), 0 6px 16px -8px color-mix(in oklch, var(--accent) 45%, transparent);
}
.create-order__opt input:checked + span small { color: var(--ink); }
.create-order__opt:active span { transform: scale(.98); }
.create-order__opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.create-order__hint { margin: 0; font-size: 12.5px; color: var(--muted); }

/* Wedding photos -------------------------------------------------------------------- */

.create-photos {
	display: grid;
	gap: 12px;
	min-width: 0;
	margin: 0;
	padding: 16px;
	background: var(--tint);
	border: 1px solid var(--line);
	border-radius: 10px;
}
.create-photos > legend {
	float: left;
	width: 100%;
	padding: 0;
}
.create-photos__pick {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	padding: 12px 16px;
	background: #fff;
	border: 1.5px dashed var(--cx-accent-line);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color var(--cx-fast) ease, background-color var(--cx-fast) ease;
}
.create-photos__pick:hover { border-color: var(--accent); background: var(--cx-accent-soft); }
.create-photos__pick input {
	position: absolute;
	inset: 0;
	width: 100%;
	opacity: 0;
	cursor: pointer;
}
.create-photos__pick:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.create-photos__pick-icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--cx-accent-soft);
	color: var(--accent);
}
.create-photos__pick-text { display: grid; gap: 2px; min-width: 0; }
.create-photos__pick-text b { font-size: 15px; color: var(--ink); }
.create-photos__pick-text small { font-size: 12.5px; color: var(--muted); }

.create-photos__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.create-photos__list[hidden] { display: none; }
.create-photos__item {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 10px;
	background: var(--line);
	animation: cx-pop .24s var(--cx-ease) both;
}
.create-photos__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.create-photos__num {
	position: absolute;
	top: 6px;
	left: 6px;
	display: grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: var(--accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.create-photos__up,
.create-photos__del {
	position: absolute;
	bottom: 6px;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(20, 20, 24, .62);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background-color var(--cx-fast) ease, transform var(--cx-fast) var(--cx-ease);
}
.create-photos__up { left: 6px; }
.create-photos__del { right: 6px; }
.create-photos__up:hover { background: var(--accent); }
.create-photos__del:hover { background: var(--cx-danger); }
.create-photos__up:active,
.create-photos__del:active { transform: scale(.9); }
.create-photos__up:focus-visible,
.create-photos__del:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.create-photos__msg { margin: 0; font-size: 12.5px; color: var(--muted); }
.create-photos__msg:empty { display: none; }
.create-photos__msg.is-error { color: var(--cx-danger); }

@keyframes cx-pop {
	from { opacity: 0; transform: scale(.92); }
	to { opacity: 1; transform: none; }
}

/* Bank account ---------------------------------------------------------------------- */

.create-bank {
	display: grid;
	gap: 12px;
	min-width: 0;
	margin: 0;
	padding: 16px;
	background: var(--tint);
	border: 1px solid var(--line);
	border-radius: 10px;
}
.create-bank > legend {
	float: left;
	width: 100%;
	padding: 0;
}
.create-bank [name="bank_holder"] { text-transform: uppercase; letter-spacing: .02em; }
.create-bank [name="bank_holder"]::placeholder { text-transform: none; }

@media (max-width: 479px) {
	.create-photos__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.create-order__opt span { padding: 8px 6px; }
	.create-order__opt b { font-size: 13.5px; }
	.create-photos__up,
	.create-photos__del { width: 28px; height: 28px; bottom: 4px; font-size: 18px; }
	.create-photos__up { left: 4px; }
	.create-photos__del { right: 4px; }
}

/* Tiles under ~70px cannot hold both buttons side by side. */
@media (max-width: 379px) {
	.create-photos__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	.create-order__opt span,
	.create-photos__pick,
	.create-photos__up,
	.create-photos__del { transition: none; }
	.create-photos__item { animation: none; }
}
