/* ------------------------------------------------------------------ */
/* IGCSE Essay Marker — frontend styles                                */
/* ------------------------------------------------------------------ */

.igcsem-app {
	max-width: 880px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
	color: #1A2233;
	line-height: 1.55;
}

.igcsem-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.05);
	padding: 28px 32px 32px;
}

/* Gate notice (non-members) */
.igcsem-gate-notice {
	padding: 1.25em 1.5em;
	background: #fffbeb;
	border: 1px solid #f0b849;
	border-radius: 10px;
	font-size: 1em;
}

/* Header row: usage pills + Cambridge badge */
.igcsem-topbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 6px;
}

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

.igcsem-pill {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 0.82em;
	font-weight: 600;
	background: #E8EEF5;
	color: #12385F;
	border: 1px solid #B9C9DB;
	white-space: nowrap;
}

.igcsem-pill-credits {
	background: #f0fdf4;
	color: #166534;
	border-color: #bbf7d0;
}

.igcsem-cambridge-note {
	font-size: 0.8em;
	color: #64748b;
	margin: 0;
}

/* "How it works" steps */
.igcsem-steps {
	background: #F4F6F9;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 14px 18px;
	margin: 16px 0 24px;
}

.igcsem-steps ol {
	margin: 0;
	padding-left: 1.3em;
}

.igcsem-steps li {
	font-size: 0.9em;
	color: #334155;
	margin: 4px 0;
}

/* Fields */
.igcsem-field {
	margin-bottom: 22px;
}

.igcsem-label-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
}

.igcsem-field label.igcsem-label {
	font-weight: 700;
	font-size: 0.95em;
	color: #12385F;
}

.igcsem-req {
	font-weight: 500;
	font-size: 0.8em;
	color: #94a3b8;
	margin-left: 6px;
}

.igcsem-hint {
	font-size: 0.83em;
	color: #64748b;
	margin: 0 0 8px;
}

.igcsem-field textarea,
.igcsem-field select {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.95em;
	background: #fff;
	color: #1A2233;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.igcsem-field textarea:focus,
.igcsem-field select:focus {
	outline: none;
	border-color: #1D4E89;
	box-shadow: 0 0 0 3px rgba(29, 78, 137, 0.15);
}

/* Upload buttons */
.igcsem-upload {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	background: #F4F6F9;
	color: #334155;
	font-size: 0.78em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.igcsem-upload:hover {
	background: #E8EEF5;
	border-color: #9DB4CC;
}

.igcsem-upload input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.igcsem-file-note {
	font-size: 0.78em;
	color: #64748b;
	margin-left: 8px;
}

.igcsem-file-note.igcsem-file-error {
	color: #b91c1c;
}

.igcsem-counter {
	text-align: right;
	font-size: 0.78em;
	color: #94a3b8;
	margin-top: 4px;
}

.igcsem-counter-over {
	color: #dc2626;
	font-weight: 700;
}

/* Submit */
.igcsem-submit-btn {
	display: block;
	width: 100%;
	background: #C0392B;
	color: #fff;
	border: none;
	padding: 14px 24px;
	font-size: 1.05em;
	font-weight: 700;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s;
}

.igcsem-submit-btn:hover {
	background: #A93226;
}

.igcsem-submit-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Status */
.igcsem-status {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 0.92em;
}

.igcsem-status-loading {
	background: #E8EEF5;
	color: #12385F;
	border: 1px solid #B9C9DB;
}

.igcsem-status-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.igcsem-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-right: 8px;
	border: 2px solid #9DB4CC;
	border-top-color: #12385F;
	border-radius: 50%;
	vertical-align: -2px;
	animation: igcsem-spin 0.8s linear infinite;
}

@keyframes igcsem-spin {
	to { transform: rotate(360deg); }
}

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

.igcsem-results {
	margin-top: 28px;
	border-top: 2px solid #e2e8f0;
	padding-top: 24px;
}

.igcsem-results h3 {
	font-size: 1.05em;
	font-weight: 700;
	color: #12385F;
	margin: 26px 0 10px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.igcsem-marks-panel {
	background: linear-gradient(135deg, #0E2A47 0%, #1D4E89 100%);
	color: #fff;
	border-radius: 12px;
	padding: 8px 22px;
}

.igcsem-mark-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 10px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.igcsem-mark-row:last-child {
	border-bottom: none;
}

.igcsem-mark-level {
	color: #B9C9DB;
	font-size: 0.85em;
	font-weight: 500;
}

.igcsem-mark-value {
	font-weight: 800;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.igcsem-mark-total {
	font-size: 1.2em;
}

.igcsem-misread-banner {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: #991b1b;
	padding: 12px 16px;
	border-radius: 8px;
	margin-top: 16px;
	font-size: 0.92em;
}

.igcsem-summary {
	font-size: 1em;
	margin-top: 4px;
}

.igcsem-rubric-table {
	width: 100%;
	border-collapse: collapse;
}

.igcsem-rubric-table th,
.igcsem-rubric-table td {
	border: 1px solid #e2e8f0;
	padding: 9px 12px;
	text-align: left;
	font-size: 0.88em;
	vertical-align: top;
}

.igcsem-rubric-table th {
	background: #F4F6F9;
	font-weight: 700;
	color: #334155;
}

.igcsem-strengths li,
.igcsem-weaknesses li {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

.igcsem-strengths,
.igcsem-weaknesses,
.igcsem-guidance {
	margin: 0;
	padding: 0;
}

.igcsem-strengths blockquote,
.igcsem-weaknesses blockquote {
	margin: 0 0 6px;
	padding: 9px 14px;
	border-left: 4px solid #16a34a;
	background: #f0fdf4;
	border-radius: 0 8px 8px 0;
	font-style: italic;
	font-size: 0.95em;
}

.igcsem-weaknesses blockquote {
	border-left-color: #dc2626;
	background: #fef2f2;
}

.igcsem-rubric-link {
	display: inline-block;
	font-style: normal;
	font-size: 0.75em;
	font-weight: 700;
	color: #12385F;
	background: #E8EEF5;
	border-radius: 999px;
	padding: 1px 8px;
	margin-left: 8px;
	vertical-align: 1px;
}

.igcsem-comment {
	margin: 4px 0 0;
	font-size: 0.93em;
	color: #334155;
}

.igcsem-guidance li {
	margin: 0 0 8px 1.2em;
	font-size: 0.95em;
}

.igcsem-book {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 8px;
	padding: 12px 16px;
	margin: 0;
	font-size: 0.95em;
}

.igcsem-usage-bar-after {
	margin-top: 24px;
	background: #f1f5f9;
	border-radius: 8px;
	padding: 10px 16px;
	font-size: 0.85em;
	color: #475569;
}

/* Mobile */
@media (max-width: 640px) {
	.igcsem-card {
		padding: 18px 16px 22px;
	}

	.igcsem-topbar {
		flex-direction: column;
		align-items: flex-start;
	}
}
