/* ============================================================================
 * notes/css/notes.css — Student Handout module (Module 4)
 * Navy + gold brand theme, matching the rest of InteligentCMS.
 * ==========================================================================*/
:root {
	--n-navy: #0f172a;
	--n-navy-deep: #0a1228;
	--n-gold: #f59e0b;
	--n-gold-soft: #d4a35a;
	--n-gold-bg: #fffbeb;
	--n-slate: #475569;
	--n-slate-lt: #64748b;
	--n-line: #e2e8f0;
	--n-paper: #ffffff;
}

.notes-wrap {
	max-width: 920px;
	margin: 12px auto 60px;
	padding: 0 16px;
	font-family: Arial, Helvetica, sans-serif;
	color: #1e293b;
}
.notes-hidden { display: none !important; }

/* Hero — compact title strip (the topbar now carries brand + navigation):
   text block left, "My handouts" right, in one slim row. */
.notes-hero {
	background: linear-gradient(135deg, var(--n-navy) 0%, var(--n-navy-deep) 100%);
	color: #fff;
	border-radius: 14px;
	padding: 12px 18px;
	box-shadow: 0 8px 22px rgba(15, 23, 42, .14);
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}
.notes-hero__main { flex: 1 1 420px; min-width: 0; }
.notes-hero__badge {
	display: inline-block;
	background: rgba(245, 158, 11, .16);
	color: var(--n-gold);
	font-weight: 700;
	font-size: 10px;
	letter-spacing: .4px;
	text-transform: uppercase;
	padding: 3px 9px;
	border-radius: 6px;
}
.notes-hero h1 { font-size: 17px; margin: 5px 0 2px; line-height: 1.2; }
.notes-hero p { color: #cbd5e1; font-size: 12.5px; margin: 0; max-width: 90ch; }
.notes-hero strong { color: var(--n-gold); }
.notes-link {
	margin: 0;
	flex: 0 0 auto;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}
.notes-link:hover { background: rgba(255, 255, 255, .16); }

/* Cards */
.notes-card {
	background: var(--n-paper);
	border: 1px solid var(--n-line);
	border-radius: 14px;
	padding: 20px 22px;
	margin-top: 16px;
	box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}
.notes-card h2 {
	color: var(--n-navy);
	font-size: 17px;
	margin: 0 0 14px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.notes-step {
	background: var(--n-gold);
	color: var(--n-navy);
	width: 26px; height: 26px;
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	font-weight: 800; font-size: 14px;
}
.notes-muted { color: var(--n-slate); font-size: 13px; }

/* Form grid */
.notes-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 16px;
	margin-bottom: 16px;
}
.notes-grid label {
	display: flex; flex-direction: column;
	font-size: 12.5px; font-weight: 600; color: var(--n-slate);
	gap: 5px;
}
.notes-grid .req { color: var(--n-gold); }
.notes-grid input {
	border: 1px solid var(--n-line);
	border-radius: 8px;
	padding: 9px 11px;
	font-size: 13.5px;
	color: #1e293b;
	font-weight: 400;
}
.notes-grid input:focus { outline: 2px solid var(--n-gold); border-color: var(--n-gold); }

.notes-paste {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 14px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--n-slate);
}
.notes-paste textarea,
.notes-extract-preview textarea,
.notes-extract-preview input,
.notes-extract-tools select {
	width: 100%;
	border: 1px solid var(--n-line);
	border-radius: 8px;
	padding: 9px 11px;
	font-size: 13px;
	color: #1e293b;
	background: #fff;
	font-family: Arial, Helvetica, sans-serif;
	box-sizing: border-box;
}
.notes-paste textarea:focus,
.notes-extract-preview textarea:focus,
.notes-extract-preview input:focus,
.notes-extract-tools select:focus {
	outline: 2px solid var(--n-gold);
	border-color: var(--n-gold);
}
.notes-extract-tools {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 16px;
	margin: 12px 0;
}
.notes-extract-tools label,
.notes-extract-preview label {
	display: flex;
	flex-direction: column;
	gap: 5px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--n-slate);
}
.notes-extract-preview {
	display: grid;
	gap: 12px;
	margin-top: 14px;
}
.notes-extract-preview .notes-lo-editor {
	border: 1px solid var(--n-line);
	border-radius: 10px;
	padding: 12px;
	background: #f8fafc;
	display: grid;
	gap: 8px;
}
.notes-extract-preview .notes-lo-editor h4 {
	margin: 0;
	color: var(--n-navy);
	font-size: 13.5px;
}
.notes-extract-preview .notes-warn {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #9a3412;
	border-radius: 8px;
	padding: 9px 11px;
	font-size: 12.5px;
}

/* Dropzone */
.notes-drop {
	border: 2px dashed var(--n-gold-soft);
	background: var(--n-gold-bg);
	border-radius: 12px;
	padding: 26px 18px;
	text-align: center;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}
.notes-drop:hover, .notes-drop.is-drag { background: #fef3c7; border-color: var(--n-gold); }
.notes-drop i { font-size: 28px; color: var(--n-gold); }
.notes-drop__lead { font-weight: 700; color: var(--n-navy); margin-top: 8px; }
.notes-drop__hint { color: var(--n-slate-lt); font-size: 12px; margin-top: 3px; }

.notes-status {
	margin-top: 12px;
	font-size: 13px;
	color: var(--n-slate);
	padding: 9px 12px;
	background: #f8fafc;
	border-radius: 8px;
	border: 1px solid var(--n-line);
}
.notes-status.is-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.notes-status.is-err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.notes-status.is-busy { background: var(--n-gold-bg); border-color: var(--n-gold-soft); color: #92400e; }

/* Actions */
.notes-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.notes-btn {
	border: none; border-radius: 10px; padding: 12px 18px;
	font-size: 14px; font-weight: 700; cursor: pointer;
	display: inline-flex; align-items: center; gap: 9px;
}
.notes-btn--gold { background: var(--n-gold); color: var(--n-navy); }
.notes-btn--gold:hover { background: #d97706; }
.notes-btn--ghost { background: #fff; color: var(--n-navy); border: 1.5px solid var(--n-line); }
.notes-btn--ghost:hover { border-color: var(--n-gold); }
.notes-btn--block { width: 100%; justify-content: center; margin-top: 14px; }
.notes-btn[disabled] { opacity: .55; cursor: not-allowed; }
.notes-balance { margin-top: 12px; font-size: 12.5px; color: var(--n-slate-lt); }

/* Modals */
.notes-modal {
	position: fixed; inset: 0;
	background: rgba(15, 23, 42, .55);
	display: flex; align-items: center; justify-content: center;
	z-index: 9000; padding: 16px;
}
.notes-modal__box {
	background: #fff; border-radius: 16px;
	width: 100%; max-width: 460px;
	padding: 24px; position: relative;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
	max-height: 90vh; overflow: auto;
}
.notes-modal__box--wide { max-width: 860px; }
.notes-modal__box h3 { color: var(--n-navy); margin: 0 0 6px; font-size: 18px; }

/* Notes loads the shared writing-hand SVG inside its own modal. Give every SVG
   part concrete colors here so unresolved app-theme variables cannot render it
   as a black block on the dark loading card. */
#notesLoading .icms-writing-anim {
	width: 140px !important;
	height: 110px !important;
	margin: 0 auto 22px !important;
}
#notesLoading .icms-writing-anim .iw-svg {
	width: 100% !important;
	height: 100% !important;
	display: block !important;
	overflow: visible !important;
}
#notesLoading .iw-paper {
	fill: #ffffff !important;
	stroke: #dbe3ef !important;
	stroke-width: 1.5 !important;
	filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .24));
}
#notesLoading .iw-rule {
	stroke: #dbe3ef !important;
	stroke-width: 1.5 !important;
}
#notesLoading .iw-ink {
	stroke: #d97706 !important;
	stroke-width: 3 !important;
	stroke-dasharray: 200 !important;
	stroke-dashoffset: 200;
	animation: notes-iw-draw 4.8s ease-in-out infinite !important;
}
#notesLoading .iw-ink-1 { animation-delay: 0s !important; }
#notesLoading .iw-ink-2 { animation-delay: 1.15s !important; }
#notesLoading .iw-ink-3 { animation-delay: 2.3s !important; }
#notesLoading .iw-pen-body { fill: #f59e0b !important; }
#notesLoading .iw-pen-grip { fill: #b45309 !important; }
#notesLoading .iw-pen-nib { fill: #111827 !important; }
#notesLoading .iw-fist {
	fill: #fee2c5 !important;
	stroke: #e7b98e !important;
	stroke-width: 1.5 !important;
}
#notesLoading .iw-hand {
	animation: notes-iw-hand-move 4.8s ease-in-out infinite !important;
}
@keyframes notes-iw-draw {
	0% { stroke-dashoffset: 200; opacity: 1; }
	22% { stroke-dashoffset: 0; }
	72% { stroke-dashoffset: 0; opacity: 1; }
	84% { stroke-dashoffset: 0; opacity: 0; }
	85% { stroke-dashoffset: 200; opacity: 0; }
	100% { stroke-dashoffset: 200; opacity: 0; }
}
@keyframes notes-iw-hand-move {
	0% { transform: translate(28px, 37px); }
	22% { transform: translate(92px, 37px); }
	24% { transform: translate(28px, 55px); }
	46% { transform: translate(92px, 55px); }
	48% { transform: translate(28px, 73px); }
	70% { transform: translate(92px, 73px); }
	84% { transform: translate(102px, 20px); }
	100% { transform: translate(28px, 37px); }
}

/* On-screen preview document — renders buildNotesHtml() output inline so the
   user SEES the handout before paying (not just a silent PDF download). */
.notes-preview-doc {
	margin-top: 12px;
	max-height: 64vh;
	overflow: auto;
	background: #fff;
	border: 1px solid var(--n-line);
	border-radius: 10px;
	padding: 20px 22px;
	box-shadow: inset 0 1px 4px rgba(15, 23, 42, .04);
}
.notes-preview-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 14px;
}
.notes-preview-actions .notes-btn { flex: 1; justify-content: center; min-width: 200px; }
.notes-modal__x {
	position: absolute; top: 12px; right: 14px;
	background: none; border: none; font-size: 26px; line-height: 1;
	color: var(--n-slate-lt); cursor: pointer;
}

/* Plans */
.notes-plans { display: flex; gap: 10px; margin: 16px 0 6px; }
.notes-plan {
	flex: 1; border: 1.5px solid var(--n-line); border-radius: 12px;
	padding: 12px 8px; text-align: center; cursor: pointer;
	display: flex; flex-direction: column; gap: 4px;
}
.notes-plan input { accent-color: var(--n-gold); }
.notes-plan:has(input:checked) { border-color: var(--n-gold); background: var(--n-gold-bg); }
.notes-plan__n { font-weight: 700; color: var(--n-navy); font-size: 13px; }
.notes-plan__p { color: var(--n-slate); font-size: 13px; }
.notes-phone { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--n-slate); margin-top: 12px; }
.notes-phone input { border: 1px solid var(--n-line); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.notes-phone input:focus { outline: 2px solid var(--n-gold); border-color: var(--n-gold); }

/* My notes list */
.notes-mylist { margin-top: 12px; }
.notes-myitem {
	border: 1px solid var(--n-line); border-radius: 10px;
	padding: 11px 13px; margin-bottom: 9px;
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.notes-myitem__t { font-weight: 700; color: var(--n-navy); font-size: 13.5px; }
.notes-myitem__m { color: var(--n-slate-lt); font-size: 12px; margin-top: 2px; }
.notes-myitem__btn { padding: 8px 12px; font-size: 12px; flex: 0 0 auto; }

@media (max-width: 620px) {
	.notes-grid { grid-template-columns: 1fr; }
	.notes-plans { flex-direction: column; }
	.notes-myitem { align-items: flex-start; flex-direction: column; }
	.notes-myitem__btn { width: 100%; justify-content: center; }
}
