/* ==========================================================================
   ADMIN CONTROL — site-wide widget for adding/removing Testimonials and
   FAQs, and changing the admin password. Built on the same tokens as the
   rest of the site (assets/css/naxer.css), so it follows the visitor's
   light/dark theme automatically rather than looking like a bolted-on
   internal tool.
   ========================================================================== */

.ac-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: var(--r-pill);
	border: 1px solid var(--on-dark-border, var(--border));
	background: transparent;
	color: var(--on-dark-muted, var(--text-muted));
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.ac-trigger:hover {
	color: var(--on-dark, var(--text));
	border-color: var(--brand-pure);
	background: rgba(227, 58, 65, 0.1);
}
.ac-trigger svg { width: 14px; height: 14px; flex-shrink: 0; }

/* -------------------------------------------------------------- overlay */
.ac-overlay {
	position: fixed;
	inset: 0;
	z-index: var(--z-overlay);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: radial-gradient(120% 100% at 50% 0%, rgba(227, 58, 65, 0.1), rgba(5, 11, 20, 0.7) 55%);
	backdrop-filter: blur(6px);
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--t-fast) var(--ease);
}
.ac-overlay.show { opacity: 1; pointer-events: auto; }

.ac-modal {
	position: relative;
	width: min(460px, 100%);
	max-height: 88vh;
	overflow-y: auto;
	overflow-x: hidden;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-xl);
	box-shadow: 0 0 0 1px var(--hairline-strong), var(--bevel), var(--shadow-xl);
	transform: translateY(16px) scale(0.97);
	transition: transform var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
.ac-overlay.show .ac-modal { transform: none; }
.ac-modal.ac-modal--wide { width: min(640px, 100%); }

/* Brand accent strip along the top edge, matching the red-to-pink accent
   used elsewhere on the site rather than a flat single colour. */
.ac-modal::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--brand-pure), var(--violet) 55%, var(--sky));
	border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.ac-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 26px 24px 0;
}
.ac-head__title { display: flex; align-items: center; gap: 12px; }
.ac-head__badge {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border-radius: var(--r-sm);
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, var(--brand-pure), var(--violet));
	color: #fff;
	box-shadow: var(--shadow-brand);
}
.ac-head__badge svg { width: 19px; height: 19px; }
.ac-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -0.01em; color: var(--text-strong); }
.ac-head p { margin: 3px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.ac-close {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--bg-alt);
	color: var(--text-muted);
	cursor: pointer;
	display: grid;
	place-items: center;
	font-size: 14px;
	transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.ac-close:hover { color: var(--text-strong); border-color: var(--border-strong); background: var(--bg-sunken); }

.ac-body { padding: 20px 24px 26px; }

/* -------------------------------------------------------------- fields */
.ac-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.ac-field span { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); }
.ac-field em { color: var(--brand-pure); font-style: normal; }
.ac-field input,
.ac-field select,
.ac-field textarea {
	font: inherit;
	font-size: 14.5px;
	padding: 12px 14px;
	border-radius: var(--r-sm);
	border: 1px solid var(--border);
	background: var(--bg-alt);
	color: var(--text);
	width: 100%;
	transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.ac-field input:hover,
.ac-field select:hover,
.ac-field textarea:hover { border-color: var(--border-strong); }
.ac-field input:focus,
.ac-field select:focus,
.ac-field textarea:focus {
	outline: none;
	border-color: var(--brand-pure);
	background: var(--surface);
	box-shadow: 0 0 0 3px var(--brand-ring);
}
.ac-field textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.ac-field-error { color: var(--brand-pure); font-size: 12px; min-height: 1em; margin-top: 2px; font-weight: 600; }
.ac-field.ac-invalid input,
.ac-field.ac-invalid textarea { border-color: var(--brand-pure); background: var(--brand-soft); }

.ac-error-banner {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	background: var(--brand-soft);
	color: var(--brand-pure);
	border: 1px solid var(--brand-ring);
	border-radius: var(--r-sm);
	padding: 11px 14px;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 16px;
}
.ac-error-banner:empty { display: none; }
.ac-error-banner::before {
	content: "";
	flex-shrink: 0;
	width: 16px; height: 16px;
	margin-top: 1px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cline x1='12' y1='8' x2='12' y2='13'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cline x1='12' y1='8' x2='12' y2='13'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ac-hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 0 0 16px; }

/* -------------------------------------------------------------- buttons */
.ac-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 14px;
	padding: 13px 18px;
	border-radius: var(--r-sm);
	border: 1px solid transparent;
	cursor: pointer;
	transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), opacity var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.ac-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ac-btn--primary { background: var(--brand-pure); border-color: var(--brand-pure); color: #fff; width: 100%; box-shadow: var(--shadow-brand); }
.ac-btn--primary:hover:not(:disabled) { background: var(--brand); transform: translateY(-1px); }
.ac-btn--primary:active:not(:disabled) { transform: none; }
.ac-btn--ghost { background: var(--bg-alt); border-color: var(--border); color: var(--text); }
.ac-btn--ghost:hover { border-color: var(--border-strong); background: var(--bg-sunken); }
.ac-btn--danger { background: var(--brand-pure); border-color: var(--brand-pure); color: #fff; }
.ac-btn--danger:hover:not(:disabled) { background: #c81b21; }
.ac-btn--sm { padding: 8px 13px; font-size: 12.5px; }
.ac-btn-row { display: flex; gap: 10px; margin-top: 6px; }
.ac-btn-row .ac-btn { flex: 1; }

/* -------------------------------------------------------------- menu view */
.ac-welcome { font-size: 13.5px; color: var(--text-muted); margin-bottom: 4px; }
.ac-welcome b { color: var(--text-strong); }

.ac-section-label {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-faint);
	margin: 4px 0 12px;
}

.ac-option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.ac-option {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	text-align: left;
	padding: 16px 18px;
	border-radius: var(--r-md);
	border: 1px solid var(--border);
	background: var(--bg-alt);
	cursor: pointer;
	transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.ac-option:hover { border-color: var(--brand-pure); transform: translateY(-2px); box-shadow: var(--shadow); background: var(--surface); }
.ac-option__icon {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	border-radius: var(--r-sm);
	display: grid;
	place-items: center;
	background: var(--brand-soft);
	color: var(--brand-pure);
}
.ac-option__icon svg { width: 21px; height: 21px; }
.ac-option strong { display: block; font-size: 14.5px; color: var(--text-strong); font-weight: 700; }
.ac-option span { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }

/* Compact variant for the 2x2 menu grid: icon stacked above a single label
   line rather than the wide icon-beside-text layout used elsewhere. */
.ac-option--compact {
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 16px;
}
.ac-option--compact strong { font-size: 13.5px; line-height: 1.3; }
.ac-option--danger .ac-option__icon--danger { background: var(--brand-soft); color: var(--brand-pure); }
.ac-option--danger:hover { border-color: var(--brand-pure); }

.ac-menu-foot {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding-top: 14px;
	border-top: 1px solid var(--border);
}
.ac-linklike {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border-radius: var(--r-sm);
	background: none;
	border: none;
	color: var(--text-muted);
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.ac-linklike svg { width: 15px; height: 15px; }
.ac-linklike:hover { color: var(--text-strong); background: var(--bg-alt); }

/* -------------------------------------------------------------- mode switch (single / multiple) */
.ac-tabs { display: flex; gap: 6px; background: var(--bg-sunken); border-radius: var(--r-sm); padding: 4px; margin-bottom: 18px; }
.ac-tab { flex: 1; padding: 8px 10px; border: none; background: transparent; border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.ac-tab.active { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-xs); }

.ac-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	color: var(--text-muted);
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	padding: 0;
	margin-bottom: 14px;
	transition: color var(--t-fast) var(--ease);
}
.ac-back:hover { color: var(--brand-pure); }
.ac-back svg { width: 14px; height: 14px; }

/* -------------------------------------------------------------- bulk rows */
.ac-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.ac-row { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-alt); padding: 14px; position: relative; }
.ac-row.ac-invalid { border-color: var(--brand-pure); box-shadow: 0 0 0 1px var(--brand-pure); }
.ac-row__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ac-row__head span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.ac-row__remove { background: none; border: none; color: var(--brand-pure); font-size: 12px; font-weight: 700; cursor: pointer; }
.ac-row .ac-field { margin-bottom: 10px; }
.ac-row .ac-field:last-child { margin-bottom: 0; }

.ac-add-row {
	width: 100%;
	padding: 11px;
	border: 1.5px dashed var(--border-strong);
	border-radius: var(--r-sm);
	background: transparent;
	color: var(--text-muted);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	margin-bottom: 16px;
	transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.ac-add-row:hover { border-color: var(--brand-pure); color: var(--brand-pure); }

/* In Single mode there's exactly one row and nothing to add or remove —
   the JS keeps the row itself untouched, this just hides the controls
   that only make sense once there's more than one. */
#acTestimonialView[data-mode="single"] .ac-add-row,
#acFaqView[data-mode="single"] .ac-add-row,
.ac-row__remove { display: none; }
#acTestimonialView[data-mode="multiple"] .ac-add-row,
#acFaqView[data-mode="multiple"] .ac-add-row { display: block; }
#acTestimonialView[data-mode="multiple"] .ac-row__remove,
#acFaqView[data-mode="multiple"] .ac-row__remove { display: inline; }

/* -------------------------------------------------------------- remove lists */
.ac-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.ac-list-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: var(--r-sm);
	background: var(--bg-alt);
	transition: opacity 0.15s ease;
}
.ac-list-row__body { min-width: 0; flex: 1; }
.ac-list-row__body strong { display: block; font-size: 13.5px; color: var(--text-strong); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-list-row__body span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ac-list-row__actions { flex-shrink: 0; }
.ac-list-row__remove-btn {
	padding: 7px 12px;
	border-radius: var(--r-sm);
	border: 1px solid var(--brand-ring);
	background: transparent;
	color: var(--brand-pure);
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	transition: background var(--t-fast) var(--ease);
}
.ac-list-row__remove-btn:hover { background: var(--brand-soft); }
.ac-list-row__confirm { display: flex; align-items: center; gap: 8px; }
.ac-list-row__confirm span { font-size: 12px; font-weight: 700; color: var(--text-strong); white-space: nowrap; }
.ac-list-empty { padding: 30px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* -------------------------------------------------------------- toasts (reuses its own container) */
.ac-toasts { position: fixed; top: 16px; right: 16px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.ac-toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--sky); border-radius: var(--r-sm); padding: 12px 14px; box-shadow: var(--shadow); font-size: 13.5px; color: var(--text); animation: ac-toast-in 0.2s var(--ease-out); }
.ac-toast--success { border-left-color: var(--live); }
.ac-toast--error { border-left-color: var(--brand-pure); }
@keyframes ac-toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 520px) {
	.ac-modal { width: 100%; }
	.ac-body { padding: 16px 18px 22px; }
	.ac-option-grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   TOUCH TARGETS
   These two controls are defined in this sheet, which loads after naxer.css,
   so the site-wide touch pass there cannot reach them. Scoped to coarse
   pointers: with a cursor the compact sizes are fine.
   ========================================================================== */
@media (pointer: coarse) {
	/* 46, not 44: the control carries a border, and box-sizing lands it a
	   pixel under the mark at exactly 44. */
	.ac-close {
		width: 46px;
		height: 46px;
	}

	.ac-linklike {
		min-height: 46px;
	}
}
