/* Instagram Earnings Calculator — frontend styles
   Mobile-first, light theme, Instagram-inspired gradient accents.
   Every rule is scoped under .iec-calculator so the plugin never
   leaks styles into the surrounding WordPress theme. */

.iec-calculator {
	--iec-grad-start: #f58529;
	--iec-grad-mid1: #dd2a7b;
	--iec-grad-mid2: #8134af;
	--iec-grad-end: #515bd4;
	--iec-gradient: linear-gradient(45deg, var(--iec-grad-start), var(--iec-grad-mid1) 45%, var(--iec-grad-mid2) 70%, var(--iec-grad-end));
	--iec-text: #17181a;
	--iec-text-muted: #6b6f76;
	--iec-text-faint: #8b8f97;
	--iec-border: #e7e4e1;
	--iec-bg: #ffffff;
	--iec-bg-soft: #faf9f8;
	--iec-radius: 18px;
	--iec-radius-sm: 12px;
	--iec-radius-xs: 8px;
	--iec-error: #d32f2f;
	--iec-error-bg: #fdecec;
	--iec-focus-ring: rgba(221, 42, 123, 0.16);

	all: initial;
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	padding: 24px;
	background: var(--iec-bg);
	border: 1px solid var(--iec-border);
	border-radius: var(--iec-radius);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--iec-text);
	box-shadow: 0 4px 28px rgba(24, 20, 30, 0.07);
}

.iec-calculator *,
.iec-calculator *::before,
.iec-calculator *::after {
	box-sizing: border-box;
	font-family: inherit;
}

.iec-calculator svg {
	display: block;
}

/* ---------- Header ---------- */

.iec-header {
	margin-bottom: 22px;
	text-align: center;
}

.iec-header-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-bottom: 10px;
	background: var(--iec-gradient);
	border-radius: 12px;
	box-shadow: 0 6px 16px rgba(221, 42, 123, 0.25);
}

.iec-title {
	display: block;
	margin: 0 0 6px;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 800;
	letter-spacing: -0.01em;
	background: var(--iec-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.iec-subtitle {
	display: block;
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--iec-text-muted);
}

/* ---------- Form ---------- */

.iec-form {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.iec-form-title {
	display: block;
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--iec-text-faint);
}

.iec-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.iec-field label {
	display: block;
	margin: 0;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--iec-text);
}

.iec-field-desc {
	display: block;
	margin: 0 0 1px;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--iec-text-muted);
}

.iec-input {
	display: block;
	width: 100%;
	min-width: 0;
	min-height: 46px;
	margin: 0;
	padding: 11px 14px;
	font-size: 16px; /* prevents iOS zoom on focus */
	font-weight: 500;
	line-height: 1.3;
	color: var(--iec-text);
	background: var(--iec-bg-soft);
	border: 1.5px solid var(--iec-border);
	border-radius: var(--iec-radius-sm);
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.iec-input::placeholder {
	color: var(--iec-text-faint);
}

select.iec-input {
	background-image: linear-gradient(45deg, transparent 50%, var(--iec-text-faint) 50%), linear-gradient(135deg, var(--iec-text-faint) 50%, transparent 50%);
	background-position: calc(100% - 20px) center, calc(100% - 15px) center;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 38px;
	cursor: pointer;
}

.iec-input:hover {
	border-color: #d5d1cc;
}

.iec-input:focus {
	outline: none;
	background: var(--iec-bg);
	border-color: var(--iec-grad-mid1);
	box-shadow: 0 0 0 4px var(--iec-focus-ring);
}

.iec-input-invalid {
	border-color: var(--iec-error);
	background: var(--iec-error-bg);
}

.iec-input-invalid:focus {
	box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.14);
}

/* Remove number input spinners for a cleaner look while keeping the field usable */
.iec-input[type="number"]::-webkit-outer-spin-button,
.iec-input[type="number"]::-webkit-inner-spin-button {
	opacity: 1;
}

.iec-field-error {
	display: block;
	min-height: 0;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--iec-error);
}

.iec-field-error:empty {
	display: none;
}

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

.iec-actions {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	margin-top: 6px;
}

.iec-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 12px 18px;
	font-size: 15px;
	font-weight: 700;
	border-radius: var(--iec-radius-sm);
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.05s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	touch-action: manipulation;
	-webkit-appearance: none;
	appearance: none;
}

.iec-btn:active {
	transform: scale(0.98);
}

.iec-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var(--iec-focus-ring);
}

.iec-btn-primary {
	color: #fff;
	background: var(--iec-gradient);
	box-shadow: 0 6px 18px rgba(221, 42, 123, 0.22);
}

.iec-btn-primary:hover {
	opacity: 0.94;
}

.iec-btn-secondary {
	color: var(--iec-text);
	background: var(--iec-bg-soft);
	border-color: var(--iec-border);
}

.iec-btn-secondary:hover {
	background: #f1efec;
	border-color: #d5d1cc;
}

/* ---------- Error banner (form-level) ---------- */

.iec-error {
	display: block;
	margin-top: 16px;
	padding: 12px 14px;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--iec-error);
	background: var(--iec-error-bg);
	border: 1px solid rgba(211, 47, 47, 0.25);
	border-radius: var(--iec-radius-sm);
}

.iec-error[hidden] {
	display: none;
}

/* ---------- Results ---------- */

.iec-results {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 22px;
	padding-top: 22px;
	border-top: 1px solid var(--iec-border);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.iec-results[hidden] {
	display: none;
}

.iec-results:focus {
	outline: none;
}

.iec-results-visible {
	opacity: 1;
	transform: translateY(0);
}

.iec-result-card {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 16px 18px;
	background: var(--iec-bg-soft);
	border: 1px solid var(--iec-border);
	border-radius: var(--iec-radius-sm);
	min-width: 0;
}

.iec-result-highlight {
	padding: 20px 18px;
	background: linear-gradient(135deg, rgba(245, 133, 41, 0.10), rgba(221, 42, 123, 0.10) 45%, rgba(81, 91, 212, 0.10));
	border-color: rgba(221, 42, 123, 0.22);
	text-align: center;
}

.iec-result-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--iec-text-muted);
}

.iec-result-value {
	display: block;
	margin-top: 2px;
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--iec-text);
	word-break: break-word;
}

.iec-result-highlight .iec-result-value {
	margin-top: 6px;
	font-size: 30px;
	background: var(--iec-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.iec-result-sub {
	display: block;
	margin-top: 8px;
	font-size: 12px;
	font-weight: 600;
	color: var(--iec-text-muted);
	letter-spacing: 0.01em;
}

.iec-result-sub strong {
	color: var(--iec-text);
	font-weight: 800;
}

.iec-result-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

.iec-disclaimer {
	display: block;
	margin: 2px 0 0;
	font-size: 12px;
	line-height: 1.55;
	color: var(--iec-text-muted);
}

/* ---------- Small phones (320px and up is the baseline above) ---------- */

@media (max-width: 359px) {
	.iec-calculator {
		padding: 16px;
	}

	.iec-title {
		font-size: 19px;
	}

	.iec-btn {
		padding: 12px 14px;
	}

	.iec-result-highlight .iec-result-value {
		font-size: 25px;
	}
}

/* ---------- Larger phones ---------- */

@media (min-width: 480px) {
	.iec-calculator {
		padding: 28px;
	}
}

/* ---------- Tablet and up ---------- */

@media (min-width: 640px) {
	.iec-form {
		grid-template-columns: 1fr 1fr;
		column-gap: 16px;
	}

	.iec-field-full,
	.iec-actions {
		grid-column: span 2;
	}

	.iec-actions {
		grid-template-columns: 1fr 1fr;
	}

	.iec-btn {
		width: auto;
	}

	.iec-result-grid {
		grid-template-columns: 1fr 1fr 1fr;
	}
}

/* ---------- Desktop ---------- */

@media (min-width: 1024px) {
	.iec-calculator {
		max-width: 720px;
		padding: 32px 36px;
	}

	.iec-title {
		font-size: 27px;
	}

	.iec-result-highlight .iec-result-value {
		font-size: 32px;
	}
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.iec-calculator * {
		transition: none !important;
		animation: none !important;
	}
}
