/* =============================================================================
   MORE HANDWRITING — SCAN  (assessment wizard styles)
   Brand: blue #2E7BF6, green #28A745, yellow #FDB913, font Nunito
   ============================================================================= */

:root {
    --blue: #2E7BF6;
    --blue-dark: #1a5dc7;
    --green: #28A745;
    --yellow: #FDB913;
    --ink: #1a1a1a;
    --muted: #6b6b6b;
    --line: #e8ecf0;
    --bg: #f5f7fa;
}

.app-header {
    background: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.app-header .logo { height: 50px; }
.app-header .help { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.app-header .help:hover { color: var(--blue); }

.assessment-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 30px 20px 80px;
}

/* Progress bar */
.progress-bar {
    height: 6px;
    background: #e6ebf1;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 30px;
}
#progressFill {
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, var(--blue), var(--green));
    transition: width 0.3s ease;
}

/* Cards / steps */
.step { display: none; }
.step.active { display: block; }
.card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
}
.card h2 { font-size: 1.4rem; color: var(--ink); margin-bottom: 8px; }
.card .lead { color: var(--muted); margin-bottom: 22px; font-size: 0.98rem; line-height: 1.6; }

/* Form fields */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--ink); margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--blue);
}
.field textarea { resize: vertical; min-height: 80px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Instruction / materials box */
.materials {
    background: #f0f7ff;
    border: 1px solid #d0e2ff;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
}
.materials h4 { color: var(--blue); font-size: 0.95rem; margin-bottom: 8px; }
.materials ul { margin: 0 0 0 18px; color: #4a4a4a; font-size: 0.92rem; }
.materials li { margin-bottom: 5px; }

.sentence-box {
    background: #fffaf0;
    border: 1px dashed var(--yellow);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: center;
    margin-bottom: 18px;
}
.sentence-box .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #b8860b; font-weight: 700; }
.sentence-box .sentence { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 6px 0; }
.sentence-box .note { font-size: 0.82rem; color: var(--muted); }

/* Checkbox ready */
.ready-check { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; }
.ready-check input { margin-top: 4px; width: 18px; height: 18px; }
.ready-check label { font-size: 0.92rem; color: #4a4a4a; }

/* Example good/bad photos */
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 18px; }
.example-box { border-radius: 10px; overflow: hidden; border: 2px solid var(--line); }
.example-box img { width: 100%; height: 150px; object-fit: cover; background: #fafafa; display: block; }
.example-cap { padding: 7px; font-size: 0.8rem; font-weight: 700; text-align: center; }
.example-cap.good { color: var(--green); background: #eafaf0; }
.example-cap.bad { color: #c0392b; background: #fdecea; }

/* Frames / download list */
.frames-list { list-style: none; margin: 0 !important; padding: 0; }
.frames-list li { margin-bottom: 8px; font-size: 0.9rem; }
.frames-list a { color: var(--blue); font-weight: 700; text-decoration: none; }
.frames-list a:hover { text-decoration: underline; }

/* Diagnosis check grid */
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 6px; }
.check-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.92rem; color: #4a4a4a; cursor: pointer;
    padding: 6px 4px;
}
.check-item input { width: 17px; height: 17px; }

/* Pencil-grip picker */
.grip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.grip-option {
    border: 2px solid var(--line); border-radius: 12px;
    background: #fff; padding: 14px 12px; text-align: center;
    cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
    font-family: inherit;
}
.grip-option:hover { border-color: var(--blue); }
.grip-option.selected { border-color: var(--green); background: #eafaf0; }
.grip-illus { margin-bottom: 6px; }
.grip-svg { width: 70px; height: 70px; display: block; margin: 0 auto; }
.grip-name { font-weight: 700; color: var(--ink); font-size: 0.92rem; }
.grip-desc { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

/* 60-second alphabet timer */
.timer-box {
    border: 2px solid var(--line); border-radius: 12px;
    padding: 22px; text-align: center; margin: 8px 0 18px;
    background: #f9fbff;
}
.timer-box.running { border-color: var(--blue); background: #eef4ff; }
.timer-box.done { border-color: var(--green); background: #eafaf0; }
.timer-display {
    font-size: 3rem; font-weight: 800; color: var(--ink);
    font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 8px;
}
.timer-box.running .timer-display { color: var(--blue); }
.timer-box.done .timer-display { color: var(--green); }
.timer-note { font-size: 0.88rem; color: var(--muted); margin-bottom: 14px; }

/* Upload cards */
.upload-card {
    border: 2px dashed var(--line);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}
.upload-card.uploaded { border-style: solid; border-color: var(--green); }
.upload-card .upload-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.upload-card .upload-sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 14px; }
.upload-card .optional-tag { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.upload-btn {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.92rem;
    border: none;
    font-family: inherit;
}
.upload-btn:hover { background: var(--blue-dark); }
.upload-card input[type="file"] { display: none; }
.preview-wrapper { position: relative; max-width: 320px; margin: 12px auto 0; }
.preview-wrapper img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.image-controls { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.control-btn {
    width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; cursor: pointer; font-size: 1rem;
}
.control-btn:hover { border-color: var(--blue); color: var(--blue); }
.control-btn.remove-btn:hover { border-color: #c0392b; color: #c0392b; }

/* Buttons / nav */
.btn-row { display: flex; gap: 12px; margin-top: 24px; }
.btn {
    padding: 14px 22px; border-radius: 10px; font-family: inherit; font-size: 1rem;
    font-weight: 700; cursor: pointer; border: none; transition: all 0.2s ease;
}
.btn-primary { background: var(--blue); color: #fff; flex: 1; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { background: #b9c7da; cursor: not-allowed; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-secondary:hover { background: #e2e2e2; }

/* Loading */
.loading { text-align: center; padding: 50px 20px; }
.spinner {
    width: 44px; height: 44px; margin: 0 auto 22px;
    border: 4px solid #e0e0e0; border-top-color: var(--blue);
    border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading h2 { color: var(--blue); font-size: 1.3rem; margin-bottom: 8px; }
.loading p { color: var(--muted); font-size: 0.95rem; }
#loadingReassurance { margin-top: 16px; font-size: 0.85rem; color: var(--muted); display: none; }

/* Results */
.result-banner {
    background: linear-gradient(135deg, var(--blue), var(--green));
    color: #fff; border-radius: 16px; padding: 28px; text-align: center; margin-bottom: 20px;
}
.result-banner h2 { color: #fff; font-size: 1.5rem; margin-bottom: 6px; }
.result-banner p { font-size: 0.98rem; opacity: 0.95; }
.result-section { background: #fff; border-radius: 14px; padding: 24px; margin-bottom: 16px; border: 1px solid #eee; }
.result-section h3 { font-size: 1.1rem; color: var(--ink); margin-bottom: 14px; }
.aspect-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.aspect-row:last-child { border-bottom: none; }
.aspect-name { font-size: 0.95rem; color: #333; }
.band { font-size: 0.78rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; }
.band.secure { background: #eafaf0; color: var(--green); }
.band.developing { background: #fff6e0; color: #b8860b; }
.band.seek_support { background: #fdecea; color: #c0392b; }
.band.na { background: #eef1f5; color: var(--muted); }
.obs-item { padding: 10px 0; font-size: 0.92rem; color: #4a4a4a; line-height: 1.6; border-bottom: 1px solid #f0f0f0; }
.obs-item:last-child { border-bottom: none; }
.signpost { background: #f0f7ff; border: 1px solid #d0e2ff; border-radius: 12px; padding: 18px 20px; font-size: 0.92rem; color: #4a4a4a; line-height: 1.6; }

/* Error */
.error-state { text-align: center; padding: 40px 20px; }
.error-state .icon { font-size: 2.5rem; margin-bottom: 12px; }
.error-state h2 { color: var(--ink); font-size: 1.3rem; margin-bottom: 10px; }
.error-state p { color: var(--muted); margin-bottom: 20px; line-height: 1.6; }

/* Trial entry */
.trial-entry { max-width: 420px; margin: 0 auto; text-align: center; }
.trial-entry input { text-align: center; letter-spacing: 0.1em; text-transform: uppercase; }

.app-footer { text-align: center; padding: 24px; color: var(--muted); font-size: 0.82rem; }
.app-footer a { color: var(--blue); text-decoration: none; }

@media (max-width: 600px) {
    .assessment-wrap { padding: 20px 14px 80px; }
    .card { padding: 24px 18px; }
    .row2 { grid-template-columns: 1fr; }
    .examples { grid-template-columns: 1fr; }
    .check-grid { grid-template-columns: 1fr; }
    .grip-grid { grid-template-columns: 1fr 1fr; }
}
