/* Stepped checkout modal for the Frappe Webshop /cart page.
   Design language: soft slate/indigo, generous spacing, subtle elevation.
   Responsive: full-height sheet on phones, centered card from ~560px up. */

:root {
	--acu-ink: #171923;
	--acu-muted: #6b7280;
	--acu-faint: #9aa1ae;
	--acu-line: #e6e8ee;
	--acu-surface: #ffffff;
	--acu-bg: #f7f8fb;
	--acu-accent: #4f46e5;
	--acu-accent-dark: #4338ca;
	--acu-accent-soft: #eef0fe;
	--acu-accent-line: #d7d9fb;
	--acu-danger: #dc2626;
	--acu-success: #16a34a;
	/* negative keywords: light red */
	--acu-neg-ink: #b91c1c;
	--acu-neg-ink-dark: #991b1b;
	--acu-neg-soft: #fef2f2;
	--acu-neg-line: #fecaca;
	--acu-radius-lg: 18px;
	--acu-radius-md: 12px;
	--acu-radius-sm: 8px;
}

.acu-cw-lock { overflow: hidden; }

.acu-cw-overlay {
	position: fixed; inset: 0; z-index: 1050;
	background: rgba(15, 17, 26, 0.55);
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
	animation: acu-fade 0.15s ease-out;
}
@keyframes acu-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes acu-rise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.acu-cw {
	background: var(--acu-surface); color: var(--acu-ink);
	width: 100%; max-width: 580px; max-height: min(90vh, 780px);
	border-radius: var(--acu-radius-lg);
	display: flex; flex-direction: column; overflow: hidden;
	font-family: inherit; font-size: 14px; line-height: 1.45;
	box-shadow: 0 24px 60px -12px rgba(15, 17, 26, 0.35), 0 2px 8px rgba(15, 17, 26, 0.08);
	animation: acu-rise 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.acu-cw-head, .acu-cw-foot {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 24px; flex: none;
}
.acu-cw-head {
	border-bottom: 1px solid var(--acu-line);
	font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
}
.acu-cw-foot {
	border-top: 1px solid var(--acu-line);
	background: var(--acu-bg);
	gap: 12px; flex-wrap: wrap;
}
.acu-cw-foot > span { font-size: 13px; color: var(--acu-muted); }
.acu-cw-foot b { margin-left: 6px; font-size: 16px; font-weight: 700; color: var(--acu-ink); }
.acu-cw-x {
	background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer;
	color: var(--acu-muted); width: 32px; height: 32px; border-radius: 999px;
	display: flex; align-items: center; justify-content: center;
	transition: background 0.15s, color 0.15s;
}
.acu-cw-x:hover { background: var(--acu-bg); color: var(--acu-ink); }

.acu-cw-body { overflow-y: auto; padding: 16px 24px 20px; flex: 1 1 auto; }

/* ---------------------------------------------------------------- steps */
.acu-step { border-radius: var(--acu-radius-md); margin: 0 0 10px; position: relative; }
.acu-step:last-child { margin-bottom: 0; }

.acu-step-h {
	display: flex; align-items: center; gap: 12px;
	padding: 13px 14px; font-weight: 600; border-radius: var(--acu-radius-md);
	transition: background 0.15s;
}
.acu-step.is-current .acu-step-h { background: var(--acu-accent-soft); color: var(--acu-accent-dark); }
.acu-step.is-todo .acu-step-h { color: var(--acu-faint); font-weight: 500; }
.acu-step.is-done .acu-step-h { cursor: pointer; color: var(--acu-ink); }
.acu-step.is-done .acu-step-h:hover { background: var(--acu-bg); }

.acu-badge {
	flex: none; width: 26px; height: 26px; border-radius: 999px;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 12px; font-weight: 700; color: #fff; background: var(--acu-faint);
	transition: background 0.15s;
}
.acu-step.is-done .acu-badge { background: var(--acu-success); }
.acu-step.is-current .acu-badge { background: var(--acu-accent); }

/* connecting line between step badges */
.acu-step:not(:last-child)::after {
	content: ""; position: absolute; left: 27px; top: 40px; bottom: -10px;
	width: 2px; background: var(--acu-line); z-index: 0;
}

.acu-step-b {
	padding: 12px 14px 18px 52px; position: relative; z-index: 1;
}

/* ---------------------------------------------------------------- fields */
.acu-step-b label { display: block; font-size: 12.5px; font-weight: 600; color: var(--acu-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.02em; }
.acu-step-b input, .acu-step-b select, .acu-step-b textarea {
	display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
	background: var(--acu-surface); border: 1.5px solid var(--acu-line); border-radius: var(--acu-radius-sm);
	font: inherit; font-weight: 500; color: var(--acu-ink); text-transform: none; letter-spacing: normal;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.acu-step-b input:disabled { background: var(--acu-bg); color: var(--acu-faint); border-style: dashed; }
.acu-step-b input:hover:not(:disabled), .acu-step-b select:hover, .acu-step-b textarea:hover { border-color: var(--acu-faint); }
.acu-step-b input:focus, .acu-step-b select:focus, .acu-step-b textarea:focus {
	outline: none; border-color: var(--acu-accent); box-shadow: 0 0 0 3px var(--acu-accent-soft);
}
.acu-btn:focus-visible, .acu-step-h:focus-visible { outline: 2px solid var(--acu-accent); outline-offset: 2px; }

.acu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.acu-inline { display: flex; gap: 8px; }
.acu-inline input { margin-top: 0; }

.acu-hint { margin: 8px 0 0; color: var(--acu-muted); font-size: 12.5px; font-weight: 500; }
.acu-error { margin: 8px 0 0; color: var(--acu-danger); font-size: 12.5px; font-weight: 600; min-height: 0; }
.acu-error:empty { display: none; }

/* "professional" dropdown used for Business / Ad account / Client account */
.acu-select-pro {
	appearance: none; -webkit-appearance: none; -moz-appearance: none;
	background-color: #fff;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%234f46e5'><path fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.293l3.71-4.06a.75.75 0 111.08 1.04l-4.24 4.65a.75.75 0 01-1.08 0l-4.24-4.65a.75.75 0 01.02-1.06z' clip-rule='evenodd'/></svg>");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 18px;
	padding-right: 36px; padding-top: 11px; padding-bottom: 11px;
	color: var(--acu-ink);
	font-weight: 600;
	border: 1.5px solid var(--acu-line);
	cursor: pointer;
}
.acu-select-pro option { color: var(--acu-ink); background: #fff; font-weight: 500; }
.acu-select-pro:hover { border-color: var(--acu-accent-line); background-color: var(--acu-accent-soft); }
.acu-select-pro:focus { border-color: var(--acu-accent); background-color: #fff; }

/* per-item campaign cards (Step 1) */
.acu-item {
	background: var(--acu-surface); border: 1.5px solid var(--acu-line); border-radius: var(--acu-radius-md);
	padding: 14px 16px; margin: 0 0 12px;
	transition: border-color 0.15s;
}
.acu-item:last-child { margin-bottom: 0; }
.acu-item:focus-within { border-color: var(--acu-accent-line); }
.acu-item-h {
	font-weight: 700; margin-bottom: 12px; display: flex;
	align-items: baseline; gap: 8px; text-transform: none; letter-spacing: normal; font-size: 14px;
}
.acu-item-qty { font-weight: 500; color: var(--acu-muted); font-size: 12.5px; }
.acu-item label span.acu-hint { display: block; margin: 6px 0 0; text-transform: none; }

/* campaign keywords (Step 1): removable chips + add row */
.acu-kw { margin: 6px 0 12px; padding-top: 12px; border-top: 1px dashed var(--acu-line); }
.acu-kw-title {
	font-size: 12.5px; font-weight: 600; color: var(--acu-muted);
	text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 8px;
}
.acu-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.acu-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 6px 4px 12px; max-width: 100%;
	background: var(--acu-accent-soft); border: 1px solid var(--acu-accent-line); border-radius: 999px;
	font-weight: 600; font-size: 13px; color: var(--acu-accent-dark);
}
.acu-chip-t { word-break: break-word; }
/* these selectors are more specific than ".acu-step-b select" on purpose */
.acu-step-b .acu-chip select.acu-chip-mt {
	display: inline-block; width: auto; margin: 0; padding: 2px 4px;
	border: 0; background: transparent; box-shadow: none;
	font-size: 11.5px; font-weight: 600; color: var(--acu-muted); cursor: pointer;
}
.acu-step-b .acu-chip select.acu-chip-mt:focus { box-shadow: none; }
.acu-chip-x {
	flex: none; border: 0; width: 20px; height: 20px; border-radius: 999px;
	background: rgba(79, 70, 229, 0.12); color: var(--acu-accent-dark);
	font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
	transition: background 0.15s, color 0.15s;
}
.acu-chip-x:hover { background: var(--acu-accent); color: #fff; }
.acu-kw-add { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; align-items: center; }
.acu-step-b .acu-kw-add input, .acu-step-b .acu-kw-add select { margin-top: 0; }
.acu-chips-sugg:empty { display: none; }
.acu-chips-sugg { align-items: center; margin-top: -2px; }
.acu-chip-ghost {
	padding: 4px 12px; background: var(--acu-surface); border-style: dashed;
	color: var(--acu-muted); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
}
.acu-chip-ghost:hover { border-color: var(--acu-accent); color: var(--acu-accent-dark); background: var(--acu-accent-soft); }
.acu-link {
	border: 0; background: none; padding: 0; margin-left: 6px;
	color: var(--acu-accent); font: inherit; font-weight: 600; cursor: pointer;
}
.acu-link:hover { text-decoration: underline; }

/* negative keywords (Step 1): same editor, light red */
.acu-kw-neg .acu-kw-title { color: var(--acu-neg-ink); }
.acu-chip.acu-chip-neg {
	background: var(--acu-neg-soft); border-color: var(--acu-neg-line); color: var(--acu-neg-ink);
}
.acu-chip-neg .acu-chip-x { background: rgba(220, 38, 38, 0.12); color: var(--acu-neg-ink); }
.acu-chip-neg .acu-chip-x:hover { background: var(--acu-danger); color: #fff; }
.acu-chip-ghost.acu-chip-neg { background: var(--acu-surface); border-style: dashed; color: var(--acu-neg-ink); }
.acu-chip-ghost.acu-chip-neg:hover { background: var(--acu-neg-soft); border-color: var(--acu-danger); color: var(--acu-neg-ink-dark); }
.acu-kw-neg .acu-link { color: var(--acu-neg-ink); }

/* step 3: chosen ad account details */
.acu-kv {
	display: grid; grid-template-columns: auto 1fr; gap: 6px 16px;
	margin: 4px 0 14px; padding: 12px 14px;
	background: var(--acu-bg); border: 1px solid var(--acu-line); border-radius: var(--acu-radius-sm);
}
.acu-kv dt { font-weight: 500; color: var(--acu-muted); font-size: 12.5px; }
.acu-kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* totals */
.acu-totals { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; margin: 0 0 12px; }
.acu-totals dt { font-weight: 500; color: var(--acu-muted); font-size: 13px; }
.acu-totals dd { margin: 0; text-align: right; font-weight: 600; }
.acu-totals .acu-gt { font-weight: 700; color: var(--acu-ink); border-top: 1px solid var(--acu-line); padding-top: 10px; font-size: 15px; }
.acu-summary { font-size: 13px; color: var(--acu-muted); display: grid; gap: 4px; }

/* review step (step 6) */
.acu-sum-title {
	font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
	text-transform: uppercase; color: var(--acu-faint); margin: 4px 0 10px;
}
.acu-sum-card {
	background: var(--acu-surface); border: 1.5px solid var(--acu-line); border-radius: var(--acu-radius-md);
	padding: 12px 16px; margin: 0 0 12px;
}
.acu-sum-card-h {
	display: flex; justify-content: space-between; align-items: baseline;
	font-weight: 700; padding-bottom: 10px; margin-bottom: 6px;
	border-bottom: 1px solid var(--acu-line);
}
.acu-sum-qty { font-weight: 500; color: var(--acu-muted); font-size: 12.5px; }
.acu-sum-row {
	display: flex; justify-content: space-between; align-items: flex-start;
	gap: 16px; padding: 6px 0; font-size: 13px;
}
.acu-sum-row > span:first-child { color: var(--acu-muted); font-weight: 500; flex: none; }
.acu-sum-row > span:last-child { text-align: right; font-weight: 600; word-break: break-word; }
.acu-sum-row small { display: block; font-weight: 400; color: var(--acu-muted); font-size: 12px; }
.acu-sum-row .acu-sum-kw { display: block; }
.acu-sum-row .acu-sum-kw small { display: inline; margin-left: 2px; }
.acu-sum-row .acu-sum-neg { color: var(--acu-neg-ink); }
.acu-draft-note {
	margin: 0 0 12px; padding: 10px 12px; font-weight: 600;
	background: var(--acu-accent-soft); border: 1px solid var(--acu-accent-line);
	border-radius: var(--acu-radius-sm); color: var(--acu-accent-dark);
}
.acu-step-b .acu-totals { margin-top: 16px; }

/* ---------------------------------------------------------------- buttons */
.acu-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.acu-btn {
	border: 0; border-radius: 999px; padding: 10px 20px;
	font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
	transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}
.acu-btn:active { transform: scale(0.98); }
.acu-btn-primary { background: var(--acu-accent); color: #fff; box-shadow: 0 2px 8px -2px rgba(79, 70, 229, 0.5); }
.acu-btn-primary:hover:not(:disabled) { background: var(--acu-accent-dark); }
.acu-btn-light { background: #fff; color: var(--acu-ink); border: 1.5px solid var(--acu-line); }
.acu-btn-light:hover:not(:disabled) { background: var(--acu-bg); }
.acu-btn:disabled { opacity: 0.55; cursor: progress; }
.acu-btn.is-busy { position: relative; color: transparent; }
.acu-btn.is-busy::after {
	content: ""; position: absolute; inset: 0; margin: auto; width: 15px; height: 15px;
	border-radius: 999px; border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff;
	animation: acu-spin 0.6s linear infinite;
}
.acu-btn-light.is-busy::after { border-color: rgba(23,25,35,0.25); border-top-color: var(--acu-ink); }
@keyframes acu-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- responsive dialog */
@media (max-width: 560px) {
	.acu-cw-overlay { padding: 0; align-items: flex-end; }
	.acu-cw {
		max-width: 100%; width: 100%; max-height: 92vh;
		border-radius: var(--acu-radius-lg) var(--acu-radius-lg) 0 0;
		animation: acu-rise-sheet 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}
	@keyframes acu-rise-sheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
	.acu-cw-head, .acu-cw-body, .acu-cw-foot { padding-left: 18px; padding-right: 18px; }
	.acu-row { grid-template-columns: 1fr; gap: 12px; }
	.acu-kw-add { grid-template-columns: 1fr 1fr; }
	.acu-kw-add input { grid-column: 1 / -1; }
	.acu-step-b { padding-left: 14px; }
	.acu-step:not(:last-child)::after { display: none; }
	.acu-cw-foot { flex-direction: column; align-items: stretch; }
	.acu-cw-foot > span { display: flex; justify-content: space-between; align-items: center; }
	.acu-cw-foot .acu-btn { width: 100%; }
}

@media (min-width: 561px) and (max-width: 700px) {
	.acu-row { grid-template-columns: 1fr; gap: 12px; }
}

/* cart page: webshop's "New Address" dialog has an optional Postal Code
   input - not needed for these orders, so it is hidden (not required there) */
.acu-cart-page .modal [data-fieldname="pincode"] { display: none; }