/* =============================================================
   פרגמטיקו · דף שיתוף
   מבנה: 3 אזורים — header | main | brand-footer
   ============================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

.mtaff-body {
	font-family: 'Assistant', system-ui, -apple-system, sans-serif;
	background: #fff;
	color: #2C2C2C;
	min-height: 100vh;
	line-height: 1.5;
}

.mtaff-app {
	max-width: 480px;
	margin: 0 auto;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: #fff;
}

/* ============ אזור 1: כותרת ============ */
.mtaff-header {
	text-align: center;
	padding: 26px 24px 20px;
	border-bottom: 1px solid #f0f0f0;
}
.mtaff-brand {
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 3px;
	color: #9b9b9b;
	margin-bottom: 4px;
}
.mtaff-subtitle {
	font-size: 17px;
	font-weight: 600;
	color: #0A2540;
}

/* ============ אזור 2: גוף ============ */
.mtaff-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 28px 24px;
}

.mtaff-stage-heading {
	font-size: 24px;
	font-weight: 700;
	color: #0A2540;
	margin-bottom: 6px;
}
.mtaff-desc {
	font-size: 14px;
	color: #888;
	line-height: 1.55;
	margin-bottom: 22px;
}

.mtaff-field-label {
	display: block;
	font-size: 13px;
	color: #555;
	margin: 14px 0 6px;
	font-weight: 500;
}
.mtaff-field-input {
	width: 100%;
	padding: 14px 14px;
	border: 1.5px solid #E0E0E0;
	border-radius: 12px;
	font-size: 16px;
	font-family: inherit;
	color: #2c2c2c;
	background: #fff;
	transition: border-color .2s;
}
.mtaff-field-input::placeholder { color: #BBB; }
.mtaff-field-input:focus { outline: none; border-color: #1D9E75; }

/* ============ כפתורים ============ */
.mtaff-btn-primary {
	display: block;
	width: 100%;
	background: #1D9E75;
	color: #fff;
	padding: 16px;
	font-size: 16px;
	font-weight: 700;
	border: none;
	border-radius: 14px;
	cursor: pointer;
	font-family: inherit;
	margin-top: 22px;
	box-shadow: 0 6px 20px rgba(29,158,117,0.25);
	transition: transform .15s, box-shadow .15s;
}
.mtaff-btn-primary:active { transform: scale(0.98); }
.mtaff-btn-primary:hover {
	box-shadow: 0 10px 28px rgba(29,158,117,0.35);
}
.mtaff-btn-primary:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.mtaff-error {
	margin-top: 14px;
	padding: 10px 14px;
	background: #FFEEEE;
	border: 1px solid #F5C2C2;
	border-radius: 10px;
	font-size: 13px;
	color: #B12C2C;
}

/* ============ בלוק "לא נמצא" במסך עמיתים ============ */
.mtaff-not-found {
	margin-top: 18px;
	padding: 14px 16px;
	background: #FFF8EC;
	border: 1px solid #F0D9A0;
	border-radius: 12px;
	text-align: center;
}
.mtaff-not-found-msg {
	font-size: 13px;
	color: #5A4A20;
	line-height: 1.6;
}
.mtaff-not-found-msg strong { color: #8A6F2A; }

/* ============ אזור 3: פוטר מותגי ============ */
.mtaff-brand-footer {
	padding: 24px 24px 28px;
	background: linear-gradient(180deg, #FAFAFA 0%, #F5F5F5 100%);
	border-top: 1px solid #f0f0f0;
	text-align: center;
}
.mtaff-bf-eyebrow {
	font-size: 11px;
	letter-spacing: 2px;
	font-weight: 700;
	color: #C9A961;
	margin-bottom: 8px;
}
.mtaff-bf-title {
	font-size: 16px;
	font-weight: 700;
	color: #0A2540;
	margin-bottom: 8px;
	line-height: 1.3;
}
.mtaff-bf-desc {
	font-size: 12px;
	color: #888;
	line-height: 1.55;
	margin-bottom: 12px;
}
.mtaff-bf-link {
	font-size: 11px;
	color: #9b9b9b;
	margin-bottom: 14px;
}
.mtaff-bf-link a {
	color: #C9A961;
	text-decoration: none;
	font-weight: 600;
}
.mtaff-btn-join {
	display: block;
	width: 100%;
	background: #fff;
	color: #1D9E75;
	border: 1.5px solid #1D9E75;
	padding: 13px;
	font-size: 14px;
	font-weight: 700;
	border-radius: 12px;
	cursor: pointer;
	font-family: inherit;
	transition: background .2s;
}
.mtaff-btn-join:hover { background: #F0FAF6; }
.mtaff-btn-join:active { transform: scale(0.98); }

/* ============ הסתרת הפוטר במסך עמיתים (יוצג רק כשמספר לא נמצא) ============ */
.mtaff-app--affiliate .mtaff-brand-footer {
	display: none;
}
.mtaff-app--affiliate.mtaff-show-footer .mtaff-brand-footer {
	display: block;
}

/* ============ שלב 2: הפוסט הממותג ============ */
.mtaff-personal-stats {
	display: flex;
	align-items: baseline;
	gap: 8px;
	background: #E6F1FB;
	border-radius: 10px;
	padding: 10px 14px;
	margin-bottom: 12px;
}
.mtaff-stats-num {
	font-size: 22px;
	font-weight: 700;
	color: #0C447C;
}
.mtaff-stats-label { font-size: 13px; color: #0C447C; }

.mtaff-success {
	font-size: 16px;
	font-weight: 700;
	color: #1D9E75;
	margin-bottom: 14px;
	text-align: right;
}

.mtaff-preview-wrap {
	margin-bottom: 16px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.mtaff-canvas {
	width: 100%;
	height: auto;
	display: block;
}

.mtaff-sig-editor {
	background: #F7F7F2;
	border: 0.5px solid #E8E4D8;
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 14px;
}
.mtaff-sig-title {
	font-size: 14px;
	font-weight: 700;
	color: #0A2540;
	margin-bottom: 4px;
}
.mtaff-sig-subtitle {
	font-size: 12px;
	color: #888;
	margin-bottom: 12px;
	line-height: 1.5;
}
.mtaff-sig-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.mtaff-sig-input {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid #D5D5D5;
	border-radius: 8px;
	font-size: 13px;
	font-family: inherit;
	background: #fff;
}
.mtaff-sig-input:focus { outline: none; border-color: #1D9E75; }

.mtaff-post-text {
	background: #DCF8C6;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 12px;
	line-height: 1.65;
	color: #111;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: break-word;
	margin-bottom: 16px;
}

.mtaff-btn-wa {
	display: block;
	width: 100%;
	background: #25D366;
	color: #fff;
	padding: 14px;
	font-size: 15px;
	font-weight: 700;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	font-family: inherit;
	margin-bottom: 12px;
	box-shadow: 0 6px 18px rgba(37,211,102,0.3);
}
.mtaff-btn-wa:active { transform: scale(0.98); }

.mtaff-actions {
	display: flex;
	gap: 8px;
	margin-bottom: 14px;
}
.mtaff-btn-secondary {
	flex: 1;
	background: #fff;
	border: 1px solid #D5D5D5;
	border-radius: 10px;
	padding: 10px;
	font-size: 13px;
	color: #444;
	cursor: pointer;
	font-family: inherit;
}
.mtaff-btn-secondary:active { transform: scale(0.98); }
.mtaff-btn-icon { max-width: 80px; }

/* עורך לוגו */
.mtaff-editor {
	background: #F7F7F2;
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 14px;
}
.mtaff-editor-title {
	font-size: 12px;
	font-weight: 700;
	color: #444;
	margin-bottom: 8px;
}
.mtaff-pos-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}
.mtaff-pos-btn {
	background: #fff;
	border: 1.5px solid #E0E0E0;
	border-radius: 8px;
	padding: 10px 4px;
	font-size: 11px;
	font-weight: 500;
	color: #444;
	cursor: pointer;
}
.mtaff-pos-btn.active {
	background: #E6F1FB;
	border-color: #378ADD;
	color: #0C447C;
}
.mtaff-size-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}
.mtaff-size-btn {
	background: #fff;
	border: 1.5px solid #E0E0E0;
	border-radius: 10px;
	padding: 10px 4px;
	font-size: 12px;
	font-weight: 600;
	color: #444;
	cursor: pointer;
}
.mtaff-size-btn.active {
	background: #E6F1FB;
	border-color: #378ADD;
	color: #0C447C;
}
.mtaff-upload-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px 12px;
	background: #fff;
	border-radius: 10px;
	border: 1px dashed #C0C0C0;
	font-size: 12px;
	color: #555;
}
.mtaff-btn-small {
	margin-right: auto;
	font-size: 11px;
	padding: 6px 12px;
	background: #fff;
	border: 1px solid #D0D0D0;
	border-radius: 8px;
	cursor: pointer;
}
.mtaff-btn-remove {
	display: block;
	width: 100%;
	margin-top: 10px;
	background: #fff;
	color: #b32d2e;
	border: 1px solid #f0c0c0;
	border-radius: 8px;
	padding: 9px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
}

/* ============ מודאל הצטרפות ============ */
.mtaff-join-modal {
	position: fixed;
	inset: 0;
	background: rgba(10,14,26,0.7);
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.mtaff-join-modal[style*="flex"] { display: flex !important; }
.mtaff-join-modal-inner {
	background: #fff;
	border-radius: 16px;
	padding: 28px 22px;
	max-width: 420px;
	width: 100%;
	position: relative;
	max-height: 90vh;
	overflow-y: auto;
}
.mtaff-join-close {
	position: absolute;
	top: 10px;
	left: 10px;
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
	color: #888;
}
.mtaff-join-modal-inner h3 {
	font-size: 20px;
	font-weight: 700;
	color: #0A2540;
	margin: 0 0 8px;
}
.mtaff-join-modal-inner > p {
	font-size: 13px;
	color: #666;
	margin-bottom: 18px;
}
.mtaff-join-modal-inner label {
	display: block;
	font-size: 12px;
	color: #666;
	margin: 12px 0 5px;
}
.mtaff-join-modal-inner input {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid #D5D5D5;
	border-radius: 9px;
	font-size: 15px;
	font-family: inherit;
}
.mtaff-join-modal-inner input:focus {
	outline: none;
	border-color: #1D9E75;
}
.mtaff-join-modal-inner .mtaff-btn-primary { margin-top: 18px; }

.mtaff-join-success { text-align: center; padding: 20px 0; }
.mtaff-join-success .mtaff-check {
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: linear-gradient(135deg, #27c089, #1D9E75);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
}
.mtaff-join-success h4 {
	font-size: 18px;
	font-weight: 700;
	color: #0A2540;
	margin: 0 0 4px;
}
.mtaff-join-success p { color: #666; font-size: 13px; }

.mtaff-empty {
	text-align: center;
	padding: 60px 20px;
}
.mtaff-empty h3 {
	font-size: 20px;
	font-weight: 700;
	color: #0A2540;
	margin-bottom: 8px;
}
.mtaff-empty p { color: #888; }
