/**
 * ModEco Trade Programme - frontend styles.
 */

.modeco-tp-panel {
	border-radius: 4px;
	padding: 16px 20px;
	margin: 0 0 24px;
}

.modeco-tp-panel h3 {
	margin: 0 0 8px;
}

.modeco-tp-panel p:last-child {
	margin-bottom: 0;
}

.modeco-tp-panel-success {
	background: #edfaef;
	border: 1px solid #a8d8b1;
}

.modeco-tp-panel-info {
	background: #eef6fd;
	border: 1px solid #b8d8f0;
}

.modeco-tp-panel-error {
	background: #fbeceb;
	border: 1px solid #e6b2ae;
}

.modeco-big-code code {
	font-size: 20px;
	letter-spacing: 0.06em;
	padding: 4px 10px;
	user-select: all;
}

.modeco-tp-form {
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 20px 24px;
	margin: 24px 0;
	max-width: 640px;
	background: #fff;
}

.modeco-tp-form h3 {
	margin-top: 0;
}

.modeco-tp-form-row {
	margin: 0 0 14px;
}

.modeco-tp-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.modeco-tp-form input[type='text'],
.modeco-tp-form input[type='email'],
.modeco-tp-form input[type='tel'],
.modeco-tp-form input[type='url'],
.modeco-tp-form select,
.modeco-tp-form textarea {
	width: 100%;
	box-sizing: border-box;
}

.modeco-tp-form-group {
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: 12px 16px 0;
	margin-bottom: 14px;
}

.modeco-tp-form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0 14px;
}

.modeco-tp-table {
	width: 100%;
	border-collapse: collapse;
	margin: 12px 0 24px;
}

.modeco-tp-table th,
.modeco-tp-table td {
	border: 1px solid #e0e0e0;
	padding: 8px 10px;
	text-align: left;
}

.modeco-tp-table th {
	background: #f6f7f7;
}

.modeco-tp-table code {
	font-size: 13px;
}

.modeco-thankyou-note {
	margin: 16px 0;
	padding: 12px 16px;
	background: #edfaef;
	border: 1px solid #a8d8b1;
	border-radius: 4px;
}

/* -------------------------------------------------------------------------
 * Trade Account application form
 * ---------------------------------------------------------------------- */

.modeco-tp-apply {
	--mca-ivory: #f6f3ec;
	--mca-paper: #fcfaf5;
	--mca-ink: #221f1b;
	--mca-muted: #7a7266;
	--mca-placeholder: #8a8378;
	--mca-line: #e2ddcf;
	--mca-line-strong: #cfc8b4;
	--mca-brass: #9c7a44;
	--mca-brass-dark: #7a5f35;
	--mca-brass-tint: #f1e9d8;
	--mca-error: #b3462c;

	max-width: 800px;
	margin: 0 auto;
	color: var(--mca-ink);
	-webkit-font-smoothing: antialiased;
}

.modeco-tp-apply .modeco-tp-panel {
	max-width: none;
}

/* Form card */

.modeco-application-form {
	background: var(--mca-paper);
	border: 1px solid var(--mca-line);
	border-radius: 2px;
	padding: 8px 40px 40px;
	margin: 0;
	max-width: none;
}

/* Sections */

.modeco-apply-section {
	padding-top: 34px;
}

.modeco-application-form > .modeco-apply-section:first-of-type {
	padding-top: 40px;
	border-top: 0;
}

.modeco-apply-section + .modeco-apply-section {
	margin-top: 8px;
	border-top: 1px solid var(--mca-line);
}

.modeco-apply-section-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 22px;
}

.modeco-apply-num {
	font-style: italic;
	font-size: 16px;
	color: var(--mca-brass);
	flex-shrink: 0;
}

.modeco-apply-section .modeco-apply-section-title {
	font-weight: 500;
	font-size: 19px;
	margin: 0;
	color: var(--mca-ink);
}

.modeco-apply-rule {
	flex: 1;
	height: 1px;
	background: var(--mca-line);
}

/* Fields */

.modeco-apply-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.modeco-apply-field {
	margin-bottom: 20px;
}

.modeco-apply-notes {
	margin-top: 28px;
}

.modeco-application-form label,
.modeco-apply-questions legend {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: var(--mca-ink);
	margin-bottom: 7px;
}

.modeco-apply-opt {
	font-weight: 400;
	color: var(--mca-muted);
}

.modeco-apply-req {
	color: var(--mca-brass-dark);
	margin-left: 2px;
}

.modeco-application-form input[type='text'],
.modeco-application-form input[type='email'],
.modeco-application-form input[type='tel'],
.modeco-application-form input[type='url'],
.modeco-application-form select,
.modeco-application-form textarea {
	width: 100%;
	box-sizing: border-box;
	font-size: 14.5px;
	color: var(--mca-ink);
	background: #fff;
	border: 1px solid var(--mca-line-strong);
	border-radius: 2px;
	padding: 11px 13px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modeco-application-form input::placeholder,
.modeco-application-form textarea::placeholder {
	color: var(--mca-placeholder);
}

.modeco-application-form input:focus,
.modeco-application-form select:focus,
.modeco-application-form textarea:focus {
	outline: none;
	border-color: var(--mca-brass);
	box-shadow: 0 0 0 3px var(--mca-brass-tint);
}

.modeco-application-form input:invalid:not(:placeholder-shown) {
	border-color: var(--mca-error);
}

.modeco-application-form textarea {
	resize: vertical;
	min-height: 96px;
	line-height: 1.5;
}

/* Selects */

.modeco-application-form select.modeco-apply-select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1L7 7L13 1' stroke='%237A7266' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.modeco-application-form select.modeco-apply-select:invalid {
	color: var(--mca-placeholder);
}

.modeco-application-form select.modeco-apply-select option {
	color: var(--mca-ink);
}

/* Project type questions */

.modeco-apply-questions {
	border: 0;
	margin: 0;
	padding: 0;
}

.modeco-apply-questions legend {
	margin-bottom: 4px;
	padding: 0;
}

.modeco-apply-legend-hint {
	font-size: 12.5px;
	color: var(--mca-muted);
	margin: 0 0 16px;
}

.modeco-apply-checks {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px 16px;
}

.modeco-apply-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	padding: 2px 0;
}

.modeco-application-form .modeco-apply-check {
	margin-bottom: 0;
}

.modeco-apply-check input[type='checkbox'],
.modeco-apply-consent input[type='checkbox'] {
	appearance: none;
	-webkit-appearance: none;
	width: 17px;
	height: 17px;
	min-width: 17px;
	border: 1px solid var(--mca-line-strong);
	border-radius: 2px;
	background: #fff;
	margin: 1px 0 0;
	position: relative;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.modeco-apply-check input[type='checkbox']:checked,
.modeco-apply-consent input[type='checkbox']:checked {
	background: var(--mca-brass);
	border-color: var(--mca-brass);
}

.modeco-apply-check input[type='checkbox']:checked::after,
.modeco-apply-consent input[type='checkbox']:checked::after {
	content: '';
	position: absolute;
	left: 4px;
	top: 1px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(40deg);
}

.modeco-apply-check input[type='checkbox']:focus-visible,
.modeco-apply-consent input[type='checkbox']:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--mca-brass-tint);
}

.modeco-apply-check span {
	font-size: 14px;
	line-height: 1.35;
	padding-top: 1px;
}

/* Marketing consent */

.modeco-apply-consent {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding-top: 32px;
	margin-top: 32px;
	border-top: 1px solid var(--mca-line);
}

.modeco-apply-consent input[type='checkbox'] {
	margin-top: 2px;
}

.modeco-application-form .modeco-apply-consent label {
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--mca-muted);
	font-weight: 400;
	margin: 0;
}

/* Submit */

.modeco-apply-submit {
	margin-top: 32px;
}

.modeco-apply-submit button {
	width: 100%;
	font-size: 14.5px;
	font-weight: 500;
	color: #fff;
	background: var(--mca-ink);
	border: none;
	border-radius: 2px;
	padding: 14px 30px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.modeco-apply-submit button:hover {
	background: var(--mca-brass-dark);
}

.modeco-apply-submit button:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--mca-brass-tint);
}

.modeco-apply-foot-note {
	text-align: center;
	font-size: 12.5px;
	color: var(--mca-muted);
	margin: 18px 0 0;
}

/* Success card */

.modeco-apply-success {
	background: var(--mca-paper);
	border: 1px solid var(--mca-line);
	border-radius: 2px;
	padding: 56px 40px;
	text-align: center;
}

.modeco-apply-success-icon {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--mca-brass-tint);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.modeco-apply-success-icon svg {
	width: 18px;
	height: 18px;
}

.modeco-tp-apply .modeco-apply-success-title {
	font-weight: 500;
	font-size: 24px;
	margin: 0 0 10px;
	color: var(--mca-ink);
}

.modeco-apply-success p {
	font-size: 14.5px;
	color: var(--mca-muted);
	line-height: 1.6;
	max-width: 38ch;
	margin: 0 auto;
}

/* Honeypot field: visually hidden but present for bots. */
.modeco-tp-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

@media screen and (max-width: 600px) {
	.modeco-application-form {
		padding: 8px 22px 28px;
	}

	.modeco-apply-grid {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.modeco-apply-checks {
		grid-template-columns: 1fr 1fr;
	}

	.modeco-apply-success {
		padding: 44px 22px;
	}
}

/* -------------------------------------------------------------------------
 * Trade Programme area (WooCommerce My Account) — design v1
 * ---------------------------------------------------------------------- */

.modeco-tp-trade {
	--ink: #21261f;
	--ink-soft: #565b4f;
	--paper: #fbf9f4;
	--panel: #ffffff;
	--line: #dad3c2;
	--line-soft: #eae5d8;
	--green: #3b5d42;
	--green-deep: #2a4230;
	--brass: #b8863b;
	--brass-soft: #f1e4c9;
	--rose: #8c4a3d;
	--rose-soft: #f3e2dc;
	--radius-sm: 3px;
	--radius-md: 5px;

	color: var(--ink);
	-webkit-font-smoothing: antialiased;
	max-width: 900px;
	margin: 8px 0 32px;
}

.modeco-tp-trade * {
	box-sizing: border-box;
}

/* Masthead */

.modeco-tp-trade-masthead {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	border-bottom: 2px solid var(--ink);
	padding-bottom: 20px;
	margin-bottom: 32px;
}

.modeco-tp-trade-masthead h1 {
	font-weight: 500;
	font-size: 2.2rem;
	line-height: 1.15;
	margin: 0;
	letter-spacing: -0.01em;
	color: var(--ink);
}

.modeco-tp-trade-masthead p {
	margin: 8px 0 0;
	color: var(--ink-soft);
	font-size: 0.98rem;
	max-width: 46ch;
	line-height: 1.5;
}

.modeco-tp-trade-chip {
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	color: var(--green-deep);
	background: var(--brass-soft);
	border: 1px solid var(--brass);
	border-radius: 20px;
	padding: 6px 14px;
	white-space: nowrap;
}

/* Ledger tabs */

.modeco-tp-trade-tabset {
	position: relative;
}

.modeco-tp-trade-tabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding: 0 0 0 4px;
	scrollbar-width: none;
}

.modeco-tp-trade-tabs::-webkit-scrollbar {
	display: none;
}

.modeco-tp-trade-tab {
	font-weight: 500;
	font-size: 0.92rem;
	color: var(--ink-soft);
	background: var(--line-soft);
	border: 1px solid var(--line);
	border-bottom: none;
	padding: 12px 20px 14px;
	cursor: pointer;
	white-space: nowrap;
	border-radius: var(--radius-md) var(--radius-md) 0 0;
	position: relative;
	top: 2px;
	transition: background 0.15s ease, color 0.15s ease, top 0.15s ease;
}

.modeco-tp-trade-tab:hover {
	background: #f3efe4;
	color: var(--ink);
}

.modeco-tp-trade-tab:focus-visible {
	outline: 2px solid var(--green);
	outline-offset: 2px;
}

.modeco-tp-trade-tab.is-active {
	background: var(--panel);
	color: var(--ink);
	border-color: var(--ink);
	top: 0;
	font-weight: 600;
}

.modeco-tp-trade-panel-outer {
	border: 1px solid var(--ink);
	border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
	background: var(--panel);
}

.modeco-tp-trade-panel {
	padding: 32px;
	display: none;
}

.modeco-tp-trade-panel.active {
	display: block;
}

.modeco-tp-trade-panel h2 {
	font-weight: 500;
	font-size: 1.35rem;
	margin: 0 0 8px;
	color: var(--ink);
}

.modeco-lede {
	color: var(--ink-soft);
	font-size: 0.95rem;
	line-height: 1.55;
	max-width: 56ch;
	margin: 0 0 26px;
}

/* Overview stats */

.modeco-trade-stats {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	overflow: hidden;
	margin-bottom: 26px;
}

.modeco-trade-stat {
	background: var(--panel);
	padding: 18px 20px;
}

.modeco-trade-stat-n {
	font-size: 1.8rem;
	color: var(--green-deep);
	line-height: 1;
}

.modeco-trade-stat-l {
	font-size: 0.82rem;
	color: var(--ink-soft);
	margin-top: 7px;
}

.modeco-trade-stat-payable {
	background: #f3f7f1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 12px;
}

.modeco-trade-withdraw-note {
	margin: 0;
	font-size: 0.78rem;
	line-height: 1.5;
	color: var(--ink-soft);
}

/* Reference code block */

.modeco-trade-codeblock {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px dashed var(--brass);
	background: var(--brass-soft);
	border-radius: var(--radius-sm);
	padding: 14px 16px;
	margin-bottom: 12px;
}

.modeco-trade-codeblock code {
	font-size: 1.05rem;
	letter-spacing: 0.03em;
	color: var(--green-deep);
	flex: 1;
}

.modeco-btn-copy,
.modeco-btn-primary {
	font-weight: 600;
	font-size: 0.82rem;
	background: var(--green);
	color: #fff;
	border: 1px solid var(--green);
	border-radius: var(--radius-sm);
	padding: 8px 16px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.modeco-btn-copy {
	background: var(--panel);
	border-color: var(--ink);
	color: var(--ink);
}

.modeco-btn-copy:hover {
	background: var(--ink);
	color: var(--paper);
}

.modeco-btn-primary {
	font-size: 0.92rem;
	padding: 12px 24px;
}

.modeco-btn-primary:hover {
	background: var(--green-deep);
}

.modeco-btn-copy:focus-visible,
.modeco-btn-primary:focus-visible {
	outline: 2px solid var(--brass);
	outline-offset: 2px;
}

.modeco-foot-note {
	font-size: 0.85rem;
	color: var(--ink-soft);
	line-height: 1.55;
	margin: 0;
}

.modeco-trade-divider {
	border: none;
	border-top: 1px solid var(--line-soft);
	margin: 30px 0 22px;
}

.modeco-section-title {
	font-weight: 500;
	font-size: 1.05rem;
	margin: 0 0 16px;
	color: var(--ink);
}

/* Form */

.modeco-trade-form {
	margin: 0;
}

.modeco-field {
	margin-bottom: 20px;
}

.modeco-field label {
	display: block;
	font-size: 0.88rem;
	font-weight: 600;
	margin-bottom: 7px;
	color: var(--ink);
}

.modeco-field .modeco-opt {
	font-weight: 400;
	color: var(--ink-soft);
}

.modeco-field input {
	width: 100%;
	font-size: 0.95rem;
	padding: 11px 13px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--paper);
	color: var(--ink);
}

.modeco-field input:focus {
	outline: 2px solid var(--green);
	outline-offset: 1px;
	border-color: var(--green);
}

.modeco-two-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

/* Messages */

.modeco-trade-confirm {
	margin: 0 0 20px;
	padding: 12px 16px;
	border: 1px solid var(--green);
	background: #eef3ec;
	color: var(--green-deep);
	border-radius: var(--radius-sm);
	font-size: 0.88rem;
}

.modeco-trade-errors {
	margin: 0 0 20px;
	padding: 12px 16px;
	border: 1px solid var(--rose);
	background: var(--rose-soft);
	color: var(--rose);
	border-radius: var(--radius-sm);
	font-size: 0.88rem;
}

.modeco-trade-errors ul {
	margin: 0;
	padding-left: 18px;
}

.modeco-trade-error {
	margin: 0 0 20px;
	padding: 12px 16px;
	border: 1px solid var(--rose);
	background: var(--rose-soft);
	color: var(--rose);
	border-radius: var(--radius-sm);
	font-size: 0.88rem;
}

.modeco-trade-error p {
	margin: 0;
}

.modeco-trade-error p + p {
	margin-top: 6px;
}

.modeco-trade-withdraw-form {
	margin: 0;
}

/* Tables */

.modeco-trade-table {
	width: 100%;
	border-collapse: collapse;
}

.modeco-trade-table th {
	text-align: left;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--ink-soft);
	padding: 0 12px 10px;
	border-bottom: 1px solid var(--ink);
}

.modeco-trade-table td {
	padding: 14px 12px;
	border-bottom: 1px solid var(--line-soft);
	font-size: 0.92rem;
	vertical-align: middle;
}

.modeco-trade-table tr:last-child td {
	border-bottom: none;
}

.modeco-trade-table td.modeco-amount,
.modeco-trade-table .modeco-amount {
	color: var(--green-deep);
}

.modeco-order-link {
	color: var(--green-deep);
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid var(--brass);
}

.modeco-order-link:hover {
	color: var(--brass);
}

.modeco-muted {
	font-size: 0.8rem;
	color: var(--ink-soft);
}

/* Status pills */

.modeco-pill {
	display: inline-block;
	font-size: 0.76rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 20px;
	white-space: nowrap;
}

.modeco-pill-pending {
	background: var(--brass-soft);
	color: #7a5a22;
}

.modeco-pill-approved,
.modeco-pill-paid {
	background: #e3eee0;
	color: var(--green-deep);
}

.modeco-pill-accepted {
	background: #f7efd8;
	color: #7c5a1e;
}

.modeco-pill-payable {
	background: #e3eee0;
	color: var(--green-deep);
}

.modeco-pill-rejected {
	background: var(--rose-soft);
	color: var(--rose);
}

.modeco-pill-cancelled {
	background: #eef0f1;
	color: #5a6368;
}

/* Empty state */

.modeco-trade-empty {
	border: 1px dashed var(--line);
	border-radius: var(--radius-sm);
	padding: 28px 24px;
	text-align: center;
	color: var(--ink-soft);
	font-size: 0.92rem;
	line-height: 1.55;
}

.modeco-trade-empty p {
	margin: 0;
}

/* Order identity in the trader's commission ledger (no customer-order links) */

.modeco-order-cell span {
	display: block;
}

.modeco-order-cell .modeco-order-no {
	font-weight: 600;
	color: var(--ink);
}

.modeco-order-cell .modeco-muted {
	margin-top: 2px;
	font-size: 0.78rem;
}

/* My Commissions ledger — compact table for quick scanning. */

.modeco-trade-ledger .modeco-order-cell .modeco-order-line {
	display: inline-block;
}

.modeco-trade-ledger .modeco-order-cell .modeco-order-no,
.modeco-trade-ledger .modeco-order-cell .modeco-order-title {
	display: inline;
	font-weight: 600;
	color: var(--ink);
}

.modeco-trade-ledger .modeco-order-cell .modeco-order-detail {
	display: block;
	font-size: 0.78rem;
	color: var(--ink-soft);
}

.modeco-trade-ledger .modeco-order-cell .modeco-order-detail + .modeco-order-detail {
	margin-top: 1px;
}

@media (max-width: 640px) {
	.modeco-tp-trade-masthead {
		flex-direction: column;
	}

	.modeco-trade-stats {
		grid-template-columns: 1fr;
	}

	.modeco-tp-trade-panel {
		padding: 24px 20px;
	}

	.modeco-two-col {
		grid-template-columns: 1fr;
	}

	.modeco-trade-codeblock {
		flex-wrap: wrap;
	}
}
