:root {
    --user-color: #6366F1;
    --bg: #F8F9FA;
    --card-bg: #FFFFFF;
    --text: #1A1A2E;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --radius: 16px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-container { text-align: center; width: 100%; max-width: 360px; }
.login-hero { margin-bottom: 40px; color: white; }
.login-icon { font-size: 72px; margin-bottom: 16px; }
.login-hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.login-hero p { font-size: 18px; opacity: 0.85; }
.user-cards { display: flex; flex-direction: column; gap: 16px; }
.user-card { display: flex; align-items: center; gap: 20px; background: white; border: none; border-radius: 20px; padding: 20px 28px; cursor: pointer; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,0.15); transition: transform 0.15s, box-shadow 0.15s; border-left: 6px solid var(--user-color); }
.user-card:hover, .user-card:active { transform: scale(1.03); box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.user-emoji { font-size: 40px; }
.user-name { font-size: 22px; font-weight: 700; color: #1A1A2E; }

/* Header */
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--card-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.header-emoji { font-size: 22px; margin-right: 8px; }
.header-name { font-weight: 700; font-size: 16px; }

/* Buttons */
.btn-primary { background: var(--user-color); color: white; border: none; border-radius: 12px; padding: 12px 20px; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-block; transition: opacity 0.15s; }
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--bg); color: var(--text); border: 2px solid var(--border); border-radius: 12px; padding: 11px 20px; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-block; }
.btn-ghost { background: none; border: none; color: var(--user-color); font-size: 15px; font-weight: 600; cursor: pointer; padding: 8px 4px; }
.btn-danger-ghost { background: none; border: none; color: #EF4444; font-size: 14px; cursor: pointer; padding: 8px 0; }
.btn-full { width: 100%; text-align: center; }
.btn-large { padding: 16px; font-size: 17px; }

/* Container */
.container { max-width: 600px; margin: 0 auto; padding: 20px 16px 60px; }
.page-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title h2 { font-size: 22px; font-weight: 800; }

/* Project grid */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.project-card { background: var(--card-bg); border-radius: var(--radius); padding: 18px 14px; border: 2px solid var(--border); transition: border-color 0.15s, transform 0.15s; }
.project-card:hover { border-color: var(--user-color); transform: translateY(-2px); }
.project-subject { font-size: 13px; color: var(--user-color); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.project-title { font-size: 15px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.project-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state p { margin-bottom: 20px; font-size: 17px; }
.empty-hint { color: var(--text-muted); font-size: 14px; margin-top: 12px; }

/* Sections */
.section { margin-bottom: 28px; }
.section h3 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.project-header h2 { font-size: 20px; font-weight: 800; margin-bottom: 20px; }

/* Upload */
.upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--user-color); border-radius: var(--radius); padding: 28px; cursor: pointer; text-align: center; color: var(--user-color); font-weight: 600; margin-bottom: 16px; transition: background 0.15s; }
.upload-zone:hover { background: color-mix(in srgb, var(--user-color) 8%, transparent); }
.upload-icon { font-size: 36px; }
.upload-hint { font-size: 12px; opacity: 0.7; font-weight: 400; }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-delete { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.6); color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }

/* Quiz actions */
.quiz-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.quiz-status { padding: 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.quiz-status.loading { background: #FEF3C7; color: #92400E; }
.quiz-status.success { background: #D1FAE5; color: #065F46; }
.quiz-status.error { background: #FEE2E2; color: #991B1B; }

/* Form */
.form-card { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px; }
label { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 15px; }
input[type="text"] { background: var(--bg); border: 2px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 16px; width: 100%; transition: border-color 0.15s; }
input[type="text"]:focus { outline: none; border-color: var(--user-color); }

/* Quiz form */
.quiz-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.quiz-form { display: flex; flex-direction: column; gap: 20px; }
.question-card { background: var(--card-bg); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.question-num { font-size: 12px; color: var(--user-color); font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.question-text { font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; }
.mcq-options { display: flex; flex-direction: column; gap: 10px; }
.mcq-option { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg); border-radius: 10px; cursor: pointer; border: 2px solid transparent; transition: border-color 0.15s, background 0.15s; font-weight: 500; }
.mcq-option:has(input:checked) { border-color: var(--user-color); background: color-mix(in srgb, var(--user-color) 10%, white); }
.mcq-option input { width: 18px; height: 18px; accent-color: var(--user-color); }
.short-answer { width: 100%; }

/* Score card */
.score-card { text-align: center; padding: 32px; border-radius: 20px; margin-bottom: 28px; }
.score-good { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); }
.score-bad { background: linear-gradient(135deg, #FEE2E2, #FECACA); }
.score-number { font-size: 56px; font-weight: 900; }
.score-label { font-size: 22px; font-weight: 700; margin-top: 8px; }

/* Results list */
.results-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.result-item { display: flex; gap: 14px; padding: 14px; border-radius: 12px; }
.result-ok { background: #F0FDF4; }
.result-ko { background: #FFF5F5; }
.result-icon { font-size: 20px; flex-shrink: 0; }
.result-question { font-weight: 600; margin-bottom: 4px; }
.result-answer { font-size: 13px; color: #EF4444; margin-bottom: 2px; }
.result-correct { font-size: 13px; color: #059669; }

.quiz-bottom-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.danger-zone { padding-top: 8px; border-top: 1px solid var(--border); }

/* Voice input */
.short-answer-row { display: flex; gap: 10px; align-items: center; }
.short-answer-row .short-answer { flex: 1; }
.voice-btn { background: var(--user-color); color: white; border: none; border-radius: 10px; width: 44px; height: 44px; font-size: 20px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: opacity 0.15s; }
.voice-btn:hover { opacity: 0.85; }

/* Voice overlay */
.voice-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
.voice-modal { background: white; border-radius: 24px; padding: 40px 32px; text-align: center; max-width: 320px; width: 90%; }
.voice-animation { font-size: 64px; margin-bottom: 16px; display: block; }
.voice-animation.pulse { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.voice-listening { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.voice-transcript { min-height: 40px; font-size: 16px; color: #6B7280; margin-bottom: 20px; font-style: italic; }
