/**
 * 11:11 Delivery Quality Tracker — front-end styles.
 * Mobile-first, namespaced under .edt-app so the theme/Divi is unaffected.
 */

.edt-app {
	--edt-bg: #f4f5f7;
	--edt-card: #ffffff;
	--edt-ink: #1a1d23;
	--edt-muted: #5b6472;
	--edt-line: #d8dce3;
	--edt-accent: #1f5fbf;
	--edt-accent-ink: #ffffff;
	--edt-ok: #1c7c43;
	--edt-warn: #b35a00;
	--edt-danger: #b3261e;
	--edt-radius: 14px;

	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto;
	padding: 12px;
	color: var(--edt-ink);
	font-size: 17px;
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
}

.edt-app *,
.edt-app *::before,
.edt-app *::after {
	box-sizing: inherit;
}

/* ---- Cards ---- */

.edt-card {
	background: var(--edt-card);
	border: 1px solid var(--edt-line);
	border-radius: var(--edt-radius);
	padding: 20px 16px;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.edt-notice {
	text-align: center;
}

/* ---- Home screen ---- */

.edt-home-header {
	text-align: center;
	margin: 8px 0 20px;
}

.edt-home-title {
	margin: 0 0 6px;
	font-size: 1.6em;
	font-weight: 700;
	line-height: 1.2;
}

.edt-home-subtitle {
	margin: 0;
	color: var(--edt-muted);
	font-size: 0.95em;
}

.edt-home-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

.edt-home-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 22px 18px;
	background: var(--edt-card);
	border: 1px solid var(--edt-line);
	border-radius: var(--edt-radius);
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
	text-decoration: none;
	color: var(--edt-ink);
	min-height: 64px;
	transition: box-shadow 0.15s ease, transform 0.05s ease;
}

.edt-home-card:hover,
.edt-home-card:focus-visible {
	box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12);
	color: var(--edt-ink);
	text-decoration: none;
}

.edt-home-card:active {
	transform: scale(0.99);
}

.edt-home-card-icon {
	font-size: 1.5em;
	line-height: 1;
	color: var(--edt-accent);
}

.edt-home-card-title {
	font-size: 1.15em;
	font-weight: 700;
}

.edt-home-card-desc {
	color: var(--edt-muted);
	font-size: 0.9em;
}

/* ---- Forms ---- */

.edt-form-title {
	margin: 0 0 8px;
	font-size: 1.35em;
	font-weight: 700;
	line-height: 1.25;
}

.edt-form-hint {
	margin: 0 0 16px;
	color: var(--edt-muted);
	font-size: 0.9em;
}

.edt-field {
	margin: 0 0 18px;
	border: 0;
	padding: 0;
	min-width: 0;
}

.edt-label {
	display: block;
	margin: 0 0 6px;
	font-weight: 600;
	font-size: 0.95em;
}

.edt-req {
	color: var(--edt-danger);
}

.edt-input {
	display: block;
	width: 100%;
	padding: 13px 14px;
	font-size: 1em;
	font-family: inherit;
	color: var(--edt-ink);
	background: #fff;
	border: 1.5px solid var(--edt-line);
	border-radius: 10px;
	min-height: 48px;
}

.edt-input:focus {
	outline: 3px solid rgba(31, 95, 191, 0.35);
	outline-offset: 1px;
	border-color: var(--edt-accent);
}

.edt-textarea {
	min-height: 90px;
	resize: vertical;
}

.edt-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* ---- Pill radio groups ---- */

.edt-pill-group legend.edt-label {
	padding: 0;
}

.edt-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.edt-pill {
	position: relative;
	display: inline-flex;
}

.edt-pill input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.edt-pill span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 10px 16px;
	border: 1.5px solid var(--edt-line);
	border-radius: 999px;
	background: #fff;
	font-size: 0.95em;
	font-weight: 500;
	user-select: none;
	transition: background 0.1s ease, border-color 0.1s ease;
}

.edt-pill input:checked + span {
	background: var(--edt-accent);
	border-color: var(--edt-accent);
	color: var(--edt-accent-ink);
}

.edt-pill input:focus-visible + span {
	outline: 3px solid rgba(31, 95, 191, 0.35);
	outline-offset: 1px;
}

/* ---- Buttons ---- */

.edt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 14px 22px;
	border: 0;
	border-radius: 12px;
	font-size: 1.05em;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	text-decoration: none;
}

.edt-btn-primary {
	background: var(--edt-accent);
	color: var(--edt-accent-ink);
	width: 100%;
}

.edt-btn-primary:hover,
.edt-btn-primary:focus-visible {
	background: #174a96;
	color: var(--edt-accent-ink);
}

.edt-btn-primary:focus-visible {
	outline: 3px solid rgba(31, 95, 191, 0.35);
	outline-offset: 2px;
}

.edt-btn[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ---- Honeypot (visually hidden, still in the DOM for bots) ---- */

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

/* ---- Result / confirmation panel ---- */

.edt-result {
	margin-top: 14px;
}

.edt-result-msg {
	padding: 14px 16px;
	border-radius: 10px;
	font-weight: 600;
}

.edt-result-success {
	background: #e7f4ec;
	color: var(--edt-ok);
	border: 1px solid #bfe3cd;
}

.edt-result-error {
	background: #fdecea;
	color: var(--edt-danger);
	border: 1px solid #f5c6c2;
}

/* ---- Recent issues ---- */

.edt-filters .edt-field {
	margin-bottom: 12px;
}

.edt-filter-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.edt-issues-list {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.edt-empty {
	color: var(--edt-muted);
	text-align: center;
	padding: 20px 0;
}

.edt-issue {
	border: 1px solid var(--edt-line);
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
}

.edt-issue-summary {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
	cursor: pointer;
	list-style: none;
}

.edt-issue-summary::-webkit-details-marker {
	display: none;
}

.edt-issue-summary:focus-visible {
	outline: 3px solid rgba(31, 95, 191, 0.35);
	outline-offset: -3px;
}

.edt-issue[open] .edt-issue-summary {
	border-bottom: 1px solid var(--edt-line);
}

.edt-issue-top {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.edt-issue-meta {
	color: var(--edt-muted);
	font-size: 0.85em;
}

.edt-issue-type {
	font-weight: 700;
}

.edt-issue-text {
	color: var(--edt-muted);
	font-size: 0.92em;
}

.edt-issue-flags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.edt-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.edt-badge-status {
	background: #eef1f5;
	color: var(--edt-muted);
}

.edt-sev-low {
	background: #e7f4ec;
	color: var(--edt-ok);
}

.edt-sev-medium {
	background: #fff4e0;
	color: var(--edt-warn);
}

.edt-sev-high {
	background: #fdecea;
	color: var(--edt-danger);
}

.edt-sev-critical {
	background: var(--edt-danger);
	color: #fff;
}

.edt-flag {
	font-size: 0.8em;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 6px;
}

.edt-flag-warn {
	background: #fff4e0;
	color: var(--edt-warn);
}

.edt-flag-ok {
	background: #e7f4ec;
	color: var(--edt-ok);
}

.edt-issue-detail {
	padding: 14px 16px;
	background: #fafbfc;
}

.edt-detail-grid {
	margin: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 2px;
}

.edt-detail-grid dt {
	font-weight: 700;
	font-size: 0.85em;
	color: var(--edt-muted);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	margin-top: 10px;
}

.edt-detail-grid dt:first-child {
	margin-top: 0;
}

.edt-detail-grid dd {
	margin: 0;
	white-space: pre-wrap;
}

/* ---- Conditional fields (toggled by JS) ---- */

[data-edt-show-if] {
	display: none;
}

[data-edt-show-if].edt-visible {
	display: block;
}

/* ---- Tablet / iPad ---- */

@media (min-width: 600px) {
	.edt-app {
		padding: 24px 16px;
	}

	.edt-card {
		padding: 28px 26px;
	}

	.edt-home-grid {
		grid-template-columns: 1fr 1fr;
	}

	.edt-filter-row {
		grid-template-columns: repeat(4, 1fr);
	}

	.edt-filter-row:last-of-type {
		grid-template-columns: 1fr 1fr;
	}
}
