/*
 * NewLife Coordinator Accounts -- front-end styles.
 *
 * Follows the site's "Нов живот" theme + NewLife Shop design: Montserrat,
 * teal accent, 10px cards, 48px inputs/buttons, soft status pills. The
 * tokens read the theme's own --nlt-* variables when the theme is active
 * (so a colour change there carries over here) and fall back to the same
 * values otherwise. Own prefix (--nla-*) so nothing collides with the
 * popup / hero slider plugins' --nl-* variables.
 *
 * Our shortcodes render inside the theme's white page card (.nlt-page),
 * so forms here are flat -- no second card inside the card. Outside the
 * theme they get their own light card instead.
 */

:root {
	--nla-accent: var(--nlt-accent, #1d8bb2);
	--nla-accent-ink: var(--nlt-accent-ink, #146a89);
	--nla-accent-soft: #eef7fa;
	--nla-text: var(--nlt-text, #1c2024);
	--nla-muted: var(--nlt-muted, #5f6770);
	--nla-line: var(--nlt-line, #dde1e6);
	--nla-input-line: #b9c0c8;
	--nla-bg: var(--nlt-bg, #f5f6f8);
	--nla-radius: var(--nlt-radius, 10px);
	--nla-font: var(--nlt-font, "Montserrat", "Motserrat-var", Helvetica, Arial, sans-serif);
	--nla-ok: #1e7b3a;
	--nla-ok-soft: #e7f5ec;
	--nla-warn: #8a5300;
	--nla-warn-soft: #fff4e0;
	--nla-error: #b3261e;
	--nla-error-soft: #fdf1f0;
}

/* ------------------------------------------------------------------ */
/* Containers                                                          */
/* ------------------------------------------------------------------ */

.nl-registration-form,
.nl-request-form,
.nl-coordinator-dashboard,
.nl-account-summary,
.nl-notice,
.nl-switcher,
.nl-table-wrap,
.nl-qo-suggestions {
	font-family: var(--nla-font);
	color: var(--nla-text);
}

.nl-registration-form,
.nl-request-form,
.nl-account-summary {
	max-width: 760px;
	margin: 0 0 1.5em;
	padding: 24px 26px;
	background: #fff;
	border: 1px solid var(--nla-line);
	border-radius: var(--nla-radius);
	box-sizing: border-box;
}

.nl-registration-form {
	max-width: 560px;
}

/* Inside the theme's page card: no card-in-a-card. */
.nlt-page .nl-registration-form,
.nlt-page .nl-request-form,
.nlt-page .nl-account-summary {
	padding: 0;
	border: 0;
	background: transparent;
}

.nl-coordinator-dashboard {
	max-width: 900px;
}

/* The theme already prints the page title as the H1. */
.nlt-page .nl-form-heading {
	display: none;
}

.nl-request-form h2,
.nl-request-form h3,
.nl-coordinator-dashboard h2,
.nl-coordinator-dashboard h3 {
	font-family: var(--nla-font);
	color: var(--nla-text);
	font-weight: 700;
	line-height: 1.25;
}

.nl-request-form h2 {
	font-size: 24px;
	margin: 0 0 0.4em;
}

.nl-request-form h3 {
	font-size: 20px;
	margin: 0 0 0.3em;
}

.nl-request-form h4 {
	font-size: 17px;
	font-weight: 700;
	margin: 1.4em 0 0.6em;
}

.nl-intro,
.nl-church-line {
	margin: 0 0 1.2em;
	color: var(--nla-muted);
	font-size: 15px;
	line-height: 1.55;
}

.nl-fine-print,
.nl-dev-note {
	margin-top: 1em;
	color: var(--nla-muted);
	font-size: 14px;
}

/* ------------------------------------------------------------------ */
/* Fields                                                              */
/* ------------------------------------------------------------------ */

.nl-field {
	display: flex;
	flex-direction: column;
	margin-bottom: 16px;
	max-width: 460px;
}

.nl-registration-form .nl-field {
	max-width: none;
}

.nl-field label,
.nl-registration-form label {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 600;
	color: var(--nla-text);
}

.nl-registration-form input[type="text"],
.nl-registration-form input[type="email"],
.nl-registration-form input[type="tel"],
.nl-registration-form input[type="password"],
.nl-request-form input[type="text"],
.nl-request-form input[type="tel"],
.nl-request-form input[type="number"],
.nl-request-form input[type="file"],
.nl-request-form select,
.nl-request-form textarea {
	width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	border: 1px solid var(--nla-input-line);
	border-radius: 8px;
	background: #fff;
	color: var(--nla-text);
	font-family: var(--nla-font);
	font-size: 16px;
	line-height: 1.4;
	box-sizing: border-box;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nl-request-form textarea {
	min-height: 96px;
	resize: vertical;
}

.nl-request-form input[type="file"] {
	padding: 10px;
	font-size: 14px;
}

.nl-registration-form input:focus,
.nl-request-form input:focus,
.nl-request-form select:focus,
.nl-request-form textarea:focus {
	outline: none;
	border-color: var(--nla-accent);
	box-shadow: 0 0 0 3px rgba(29, 139, 178, 0.18);
}

.nl-coordinator-fields {
	gap: 4px;
	padding-left: 14px;
	border-left: 3px solid var(--nla-accent);
}

.nl-coordinator-fields label {
	margin-top: 8px;
}

/* ------------------------------------------------------------------ */
/* Buttons -- same as NewLife Shop's .nls-btn                          */
/* ------------------------------------------------------------------ */
/* The theme styles every `.button` / submit button inside page content
   as a filled button with no border, at a higher specificity than a
   plain class -- so background, border and colour carry !important
   here, otherwise the outline (secondary) buttons would all turn solid. */

.nl-submit,
.nl-registration-form .button,
.nl-request-form .button,
.nl-coordinator-dashboard .button,
.nl-notice .button,
.nl-switcher .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 22px;
	border: 2px solid var(--nla-accent) !important;
	border-radius: var(--nla-radius) !important;
	background: #fff !important;
	color: var(--nla-accent-ink) !important;
	font-family: var(--nla-font);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	text-shadow: none;
	box-shadow: none;
	box-sizing: border-box;
	cursor: pointer;
	transition: filter 0.15s ease, background-color 0.15s ease;
}

.nl-submit,
.nl-registration-form .button-primary,
.nl-request-form .button-primary,
.nl-coordinator-dashboard .button-primary,
.nl-coordinator-dashboard .nl-new-request-btn,
.nl-notice .button-primary,
.nl-switcher .button-primary {
	background: var(--nla-accent) !important;
	color: #fff !important;
}

.nl-registration-form .button:hover,
.nl-request-form .button:hover,
.nl-coordinator-dashboard .button:hover,
.nl-notice .button:hover,
.nl-switcher .button:hover,
.nl-coordinator-dashboard .nl-quick-order-btn:hover {
	background: var(--nla-accent-soft) !important;
}

.nl-submit:hover,
.nl-registration-form .button-primary:hover,
.nl-request-form .button-primary:hover,
.nl-coordinator-dashboard .button-primary:hover,
.nl-coordinator-dashboard .nl-new-request-btn:not(.nl-quick-order-btn):hover,
.nl-notice .button-primary:hover,
.nl-switcher .button-primary:hover {
	background: var(--nla-accent-ink) !important;
	border-color: var(--nla-accent-ink) !important;
}

.nl-submit:focus-visible,
.nl-coordinator-dashboard .button:focus-visible,
.nl-request-form .button:focus-visible {
	outline: 3px solid rgba(29, 139, 178, 0.35);
	outline-offset: 2px;
}

.nl-registration-form .nl-submit {
	width: 100%;
	margin-top: 8px;
}

.nl-form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

/* Small buttons inside tables */
.nl-my-requests .button,
.nl-row-actions .button {
	min-height: 38px;
	padding: 7px 14px;
	font-size: 14px;
	border-width: 1.5px;
	margin: 0 6px 6px 0;
}

/* ------------------------------------------------------------------ */
/* Notices                                                             */
/* ------------------------------------------------------------------ */

.nl-notice {
	margin: 0 0 18px !important;
	padding: 14px 18px !important;
	border: 1px solid #cfe6ef;
	border-radius: var(--nla-radius);
	background: var(--nla-accent-soft);
	font-size: 15px;
	line-height: 1.5;
}

.nl-notice p {
	margin: 0 0 0.5em;
}

.nl-notice p:last-child {
	margin-bottom: 0;
}

.nl-notice h3 {
	margin: 0 0 0.4em;
	font-size: 18px;
	font-weight: 700;
}

.nl-notice-success {
	background: var(--nla-ok-soft);
	border-color: #bfe3cb;
}

.nl-notice-error {
	background: var(--nla-error-soft);
	border-color: #f3c7c3;
	color: var(--nla-error);
}

.nl-notice-error ul {
	margin: 0.3em 0 0;
	padding-left: 1.2em;
}

.nl-draft-reminder {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--nla-warn-soft);
	border-color: #f5d9a6;
	color: var(--nla-warn);
}

.nl-deadline-note {
	display: block;
	margin-top: 4px;
	color: var(--nla-warn);
	font-size: 13px;
	font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Church / campaign switchers                                         */
/* ------------------------------------------------------------------ */

.nl-switcher {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
}

.nl-switcher label {
	margin-right: 4px;
	font-weight: 600;
}

.nl-switcher .button {
	min-height: 40px;
	padding: 8px 16px;
	font-size: 15px;
}

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */

.nl-table-wrap {
	max-width: 100%;
	overflow-x: auto;
}

.nl-items-form-table,
.nl-my-requests {
	width: 100%;
	margin: 0 0 18px;
	border: 1px solid var(--nla-line);
	border-radius: var(--nla-radius);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	background: #fff;
	font-family: var(--nla-font);
	font-size: 15px;
}

.nl-items-form-table th,
.nl-items-form-table td,
.nl-my-requests th,
.nl-my-requests td {
	padding: 12px 14px;
	border: 0;
	border-bottom: 1px solid var(--nla-line);
	text-align: left;
	vertical-align: middle;
}

.nl-items-form-table tr:last-child td,
.nl-my-requests tr:last-child td {
	border-bottom: 0;
}

.nl-items-form-table th,
.nl-my-requests th {
	background: var(--nla-bg);
	color: var(--nla-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.nl-my-requests tbody tr:hover {
	background: #fafbfc;
}

.nl-items-form-table input[type="number"] {
	width: 100px;
	min-height: 44px;
}

.nl-qo-table {
	table-layout: fixed;
}

.nl-remove-item {
	color: var(--nla-muted);
	cursor: pointer;
	font-size: 16px;
}

.nl-remove-item:hover {
	color: var(--nla-error);
}

/* ------------------------------------------------------------------ */
/* Status pills -- same shape/colours as NewLife Shop's .nls-status    */
/* ------------------------------------------------------------------ */

.nl-status {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	background: #eef0f3;
	color: #3d444b;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
}

.nl-status-submitted,
.nl-status-sent {
	background: var(--nla-accent-soft);
	color: var(--nla-accent-ink);
}

.nl-status-under_review,
.nl-status-in_preparation {
	background: var(--nla-warn-soft);
	color: var(--nla-warn);
}

.nl-status-confirmed,
.nl-status-completed {
	background: var(--nla-ok-soft);
	color: var(--nla-ok);
}

.nl-status-declined {
	background: var(--nla-error-soft);
	color: var(--nla-error);
}

/* ------------------------------------------------------------------ */
/* Coordinator dashboard (Моят профил)                                 */
/* ------------------------------------------------------------------ */

.nl-dashboard-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--nla-line);
}

.nl-dashboard-header h2 {
	margin: 0 0 4px;
	font-size: 22px;
}

.nl-dashboard-meta {
	margin: 0;
	color: var(--nla-muted);
	font-size: 15px;
}

.nl-logout-link {
	color: var(--nla-muted) !important;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

.nl-logout-link:hover {
	color: var(--nla-accent-ink) !important;
}

.nl-dashboard-actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 12px;
	margin-bottom: 28px;
}

.nl-dashboard-actions .nl-new-request-btn {
	width: 100%;
	min-height: 56px;
	font-size: 17px;
}

/* Second action as the outline variant, so the two read as a pair */
.nl-coordinator-dashboard .nl-dashboard-actions .nl-quick-order-btn {
	background: #fff !important;
	color: var(--nla-accent-ink) !important;
}

.nl-dashboard-subheading {
	margin: 28px 0 12px !important;
	font-size: 18px !important;
}

/* ------------------------------------------------------------------ */
/* Delivery details -- required on every order                         */
/* ------------------------------------------------------------------ */

.nl-delivery {
	margin: 24px 0 8px;
	padding: 18px 20px 16px;
	border: 1px solid var(--nla-line);
	border-radius: var(--nla-radius);
	background: var(--nla-bg);
	min-width: 0;
}

.nl-delivery legend {
	float: left;
	width: 100%;
	margin: 0 0 6px;
	padding: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--nla-text);
}

.nl-delivery legend + * {
	clear: both;
}

.nl-delivery .nl-required {
	color: var(--nla-error);
}

.nl-delivery-hint {
	margin: 0 0 14px;
	color: var(--nla-muted);
	font-size: 14px;
	line-height: 1.5;
}

.nl-delivery .nl-field {
	max-width: 520px;
}

.nl-delivery input[type="text"],
.nl-delivery input[type="tel"],
.nl-delivery select {
	width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	border: 1px solid var(--nla-input-line);
	border-radius: 8px;
	background: #fff;
	font-family: var(--nla-font);
	font-size: 16px;
	box-sizing: border-box;
}

.nl-delivery .nl-delivery-confirm {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 6px 0 0;
	padding: 12px 14px;
	border: 1px solid #f5d9a6;
	border-radius: 8px;
	background: var(--nla-warn-soft);
	color: var(--nla-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.45;
	cursor: pointer;
}

.nl-delivery .nl-delivery-confirm input {
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	flex: none;
	accent-color: var(--nla-accent);
}

/* .nl-field sets display:flex, which would otherwise beat the [hidden]
   attribute and keep the unused office/address field on screen. */
.nl-delivery [hidden] {
	display: none !important;
}

/* ------------------------------------------------------------------ */
/* Book autocomplete (Групова поръчка на книги)                        */
/* ------------------------------------------------------------------ */

.nl-qo-autocomplete {
	width: 100%;
}

.nl-qo-book-input {
	width: 100%;
	box-sizing: border-box;
}

/* Appended to <body> and positioned by JS (see the shortcode script). */
.nl-qo-suggestions {
	position: fixed;
	z-index: 99999;
	box-sizing: border-box;
	max-height: 260px;
	margin: 4px 0 0;
	padding: 4px 0;
	overflow-y: auto;
	list-style: none !important;
	background: #fff;
	border: 1px solid var(--nla-line);
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(12, 18, 24, 0.14), 0 2px 8px rgba(12, 18, 24, 0.06);
	font-size: 16px;
}

.nl-qo-suggestions li {
	margin: 0;
	padding: 10px 14px;
	list-style-type: none !important;
	color: var(--nla-text);
	font-family: inherit;
	font-size: inherit;
	white-space: normal;
	cursor: pointer;
}

.nl-qo-suggestions li:hover,
.nl-qo-suggestions li.is-active {
	background: var(--nla-accent-soft);
	color: var(--nla-accent-ink);
}

/* ------------------------------------------------------------------ */
/* Persistent "Моят профил" button (coordinators only)                 */
/* ------------------------------------------------------------------ */

.nl-floating-account-btn {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 9999;
	padding: 10px 18px;
	border-radius: 999px;
	background: #e03131;
	color: #fff !important;
	font-family: var(--nla-font);
	font-size: 15px;
	font-weight: 700;
	text-decoration: none !important;
	box-shadow: 0 6px 18px rgba(12, 18, 24, 0.22);
	transition: filter 0.15s ease, transform 0.15s ease;
}

.nl-floating-account-btn:hover {
	filter: brightness(0.93);
	transform: translateY(-1px);
}

/* The new site header (NewLife Shop) is sticky and has the account and
   cart icons in the top-right corner -- keep the button out of their
   way by placing it in the bottom-right instead. */
body.nls-layout .nl-floating-account-btn {
	top: auto;
	bottom: 20px;
	right: 20px;
}

@media (max-width: 480px) {
	.nl-floating-account-btn {
		top: auto;
		bottom: 16px;
		right: 16px;
		padding: 9px 15px;
		font-size: 14px;
	}
}

/* ------------------------------------------------------------------ */
/* Legacy bits still printed by older shortcodes                       */
/* ------------------------------------------------------------------ */

.nl-access-list {
	list-style: none;
	padding: 0;
}

.nl-access-list li {
	padding: 4px 0;
}

.nl-access-denied {
	color: var(--nla-muted);
}

.nl-group-requests-stub {
	margin-top: 16px;
	padding: 18px 20px;
	border: 1px solid #cfe6ef;
	border-radius: var(--nla-radius);
	background: var(--nla-accent-soft);
	font-family: var(--nla-font);
}

.nl-group-requests-stub h3 {
	margin-top: 0;
	color: var(--nla-accent-ink);
}

.nl-inline-form {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.nl-inline-form input {
	width: 110px;
	padding: 6px;
}

/* ------------------------------------------------------------------ */
/* Phones                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 600px) {
	/* The requests / orders lists become one card per row, like the
	   shop's order list, instead of a table that scrolls sideways and
	   hides the action buttons. */
	.nl-cards-on-phone,
	.nl-cards-on-phone tbody,
	.nl-cards-on-phone tr,
	.nl-cards-on-phone td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	.nl-cards-on-phone {
		border: 0;
		background: transparent;
		overflow: visible;
	}

	.nl-cards-on-phone thead {
		display: none;
	}

	.nl-cards-on-phone tr {
		margin-bottom: 12px;
		padding: 8px 0;
		border: 1px solid var(--nla-line);
		border-radius: var(--nla-radius);
		background: #fff;
	}

	.nl-cards-on-phone td {
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		gap: 12px;
		padding: 6px 14px !important;
		border: 0 !important;
		text-align: right;
	}

	.nl-cards-on-phone td[data-label]::before {
		content: attr(data-label);
		flex: none;
		color: var(--nla-muted);
		font-size: 13px;
		font-weight: 600;
		text-align: left;
	}

	.nl-cards-on-phone td[colspan] {
		justify-content: center;
		text-align: center;
	}

	.nl-cards-on-phone .nl-row-actions {
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-start;
		gap: 8px;
		padding-top: 10px !important;
		text-align: left;
	}

	.nl-cards-on-phone .nl-row-actions .button {
		flex: 1 1 auto;
		margin: 0;
	}

	.nl-cards-on-phone .nl-row-actions .nl-deadline-note {
		flex-basis: 100%;
		margin: 0;
	}

	.nl-cards-on-phone tbody tr:hover {
		background: #fff;
	}

	.nl-correction-table th:nth-child(n+2),
	.nl-correction-table td:nth-child(n+2) {
		width: 76px;
		text-align: center;
	}

	.nl-correction-table input[type="number"] {
		width: 70px;
	}

	.nl-registration-form,
	.nl-request-form,
	.nl-account-summary {
		padding: 18px 16px;
	}

	.nlt-page .nl-registration-form,
	.nlt-page .nl-request-form,
	.nlt-page .nl-account-summary {
		padding: 0;
	}

	.nl-form-actions .nl-submit,
	.nl-form-actions .button {
		width: 100%;
	}

	.nl-delivery {
		padding: 14px 14px 12px;
	}

	.nl-items-form-table th,
	.nl-items-form-table td,
	.nl-my-requests th,
	.nl-my-requests td {
		padding: 10px;
	}
}

.nl-coordinator-dashboard .nl-dashboard-actions .nl-quick-order-btn:hover {
	background: var(--nla-accent-soft) !important;
}

/* The theme forces white text on every submit button in page content
   (`.nlt-content button[type="submit"]`, !important) -- which made the
   outline "Запази като чернова" button white-on-white. Out-rank it. */
.nl-request-form button.button:not(.button-primary),
.nl-coordinator-dashboard button.button:not(.button-primary),
.nl-registration-form button.button:not(.button-primary) {
	background: #fff !important;
	border: 2px solid var(--nla-accent) !important;
	color: var(--nla-accent-ink) !important;
}

.nl-request-form button.button:not(.button-primary):hover,
.nl-coordinator-dashboard button.button:not(.button-primary):hover {
	background: var(--nla-accent-soft) !important;
}

/* ------------------------------------------------------------------ */
/* 0.4.0 -- Speedy / Еконт picker, tracking, book orders               */
/* ------------------------------------------------------------------ */

.nl-field-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 14px;
	max-width: 620px;
}

.nl-field-row > .nl-field {
	max-width: none;
}

.nl-field-row--5 {
	grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr));
}

.nl-dl-status {
	display: block;
	margin-top: 4px;
	color: var(--nla-error);
	font-size: 13px;
}

.nl-dl-status:empty {
	display: none;
}

.nl-qo-suggestions .nl-sugg-sub {
	display: block;
	margin-top: 2px;
	color: var(--nla-muted);
	font-size: 13px;
	font-weight: 500;
}

.nl-qo-suggestions li:hover .nl-sugg-sub,
.nl-qo-suggestions li.is-active .nl-sugg-sub {
	color: var(--nla-accent-ink);
}

.nl-tracking-note,
.nl-muted {
	display: block;
	margin-top: 4px;
	color: var(--nla-muted);
	font-size: 13px;
}

.nl-status-new {
	background: var(--nla-accent-soft);
	color: var(--nla-accent-ink);
}

@media (max-width: 600px) {
	.nl-field-row {
		grid-template-columns: 1fr;
	}

	.nl-field-row--5 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.nl-cards-on-phone .nl-row-actions .nl-tracking-note {
		flex-basis: 100%;
		margin: 0;
	}
}

/* Book order: a chosen book without a quantity, or a typed title that
   wasn't picked from the list. */
.nl-request-form input.nl-qo-missing {
	border-color: var(--nla-error) !important;
	background: var(--nla-error-soft) !important;
	box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.15) !important;
}
