/* ============================================================
   MentorIA — styles.css
   ============================================================ */

/* ── TOKENS ── */
:root {
  --bg: #f8f9fc;
  --bg-3: #f0f2f8;
  --surface: #fff;
  --blue-50: #eef2ff;
  --blue-100: #e0e7ff;
  --blue-400: #818cf8;
  --blue-500: #6366f1;
  --blue-600: #4f46e5;
  --blue-700: #4338ca;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --error: #ef4444;
  --error-bg: #fee2e2;
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12);
  --shadow-xl: 0 24px 64px rgba(15,23,42,.16);
  --shadow-blue: 0 8px 30px rgba(99,102,241,.25);
  --shadow-glow: 0 0 0 3px rgba(99,102,241,.15);
  --sidebar-w: 256px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --t: 0.2s cubic-bezier(.4,0,.2,1);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── VIEWS ── */
.view { display: none !important; }
.view.active { display: block !important; }
#login.active, #register.active { display: flex !important; min-height: 100vh; align-items: center; justify-content: center; }
#app.active { display: flex !important; }

/* ── UTILS ── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.w-full { width: 100%; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--text-secondary); }
.text-brand { color: var(--blue-500); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius); font-size: .875rem; font-weight: 600; transition: all var(--t); white-space: nowrap; line-height: 1; cursor: pointer; }
.btn-primary { background: linear-gradient(135deg,var(--blue-600),var(--blue-500)); color: #fff; box-shadow: var(--shadow-blue); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(99,102,241,.35); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border: 1.5px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--blue-400); background: var(--blue-50); color: var(--blue-600); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1.5px solid transparent; }
.btn-ghost:hover { background: var(--bg-3); color: var(--text-primary); }
.btn-danger { background: var(--error-bg); color: var(--error); border: 1.5px solid rgba(239,68,68,.2); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: var(--success-bg); color: var(--success); border: 1.5px solid rgba(16,185,129,.2); }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-xl { padding: 16px 36px; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--border); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; }
.btn-icon:hover { border-color: var(--blue-400); color: var(--blue-500); background: var(--blue-50); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── FORMS ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: .8rem; font-weight: 600; color: var(--text-secondary); }
.form-input { padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .9rem; color: var(--text-primary); background: var(--surface); transition: all var(--t); outline: none; width: 100%; }
.form-input:focus { border-color: var(--blue-500); box-shadow: var(--shadow-glow); }
.form-input::placeholder { color: var(--text-tertiary); }

/* ── BADGE ── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-full); font-size: .72rem; font-weight: 700; }
.badge-blue { background: var(--blue-100); color: var(--blue-600); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-yellow { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--error-bg); color: var(--error); }
.badge-gray { background: var(--bg-3); color: var(--text-secondary); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }

/* ── CARD ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-title { font-size: .95rem; font-weight: 700; }
.card-body { padding: 22px; }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius-lg); font-size: .875rem; font-weight: 500; box-shadow: var(--shadow-xl); pointer-events: all; transform: translateX(120%); transition: transform .4s; max-width: 360px; color: #fff; }
.toast.show { transform: translateX(0); }
.toast-success { background: #065f46; }
.toast-error { background: #7f1d1d; }
.toast-info { background: #1e3a5f; }

/* ── MODAL ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(6px); z-index: 800; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border-radius: var(--radius-xl); padding: 32px; width: 90%; max-width: 520px; box-shadow: var(--shadow-xl); transform: scale(.96) translateY(8px); transition: transform .2s; }
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: 'Sora', sans-serif; font-size: 1.2rem; font-weight: 700; }
.modal-close { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-3); border: none; cursor: pointer; font-size: .9rem; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--border); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── SPINNER ── */
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner-dark { border-color: rgba(99,102,241,.2); border-top-color: var(--blue-500); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PROGRESS BARS ── */
.progress-track { height: 6px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 1.2s ease; }
.progress-label-row { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 5px; }
.progress-wrap { display: flex; flex-direction: column; gap: 13px; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
#landing { background: #fff; }
.lp-nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.lp-nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 32px; height: 68px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: 'Sora', sans-serif; font-size: 1.4rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 34px; height: 34px; background: linear-gradient(135deg,var(--blue-600),var(--violet)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.logo span { color: var(--blue-600); }
.lp-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.lp-links a { padding: 8px 14px; border-radius: var(--radius); font-size: .875rem; font-weight: 500; color: var(--text-secondary); transition: all var(--t); text-decoration: none; }
.lp-links a:hover { background: var(--bg-3); color: var(--text-primary); }
.hero { max-width: 1200px; margin: 0 auto; padding: 80px 32px; text-align: center; }
.hero h1 { font-family: 'Sora', sans-serif; font-size: clamp(2.2rem,5vw,3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 20px; }
.hero h1 .hl { background: linear-gradient(135deg,var(--blue-600),var(--violet)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 560px; margin: 0 auto 36px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.features-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; max-width: 1200px; margin: 60px auto 0; padding: 0 32px; }
.feature-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; transition: all var(--t); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon-wrap { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }
.lp-footer { background: var(--text-primary); padding: 40px 32px; text-align: center; color: rgba(255,255,255,.5); font-size: .85rem; margin-top: 80px; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
#login, #register { background: linear-gradient(135deg,#f0f4ff,#f8faff,#f0e8ff); min-height: 100vh; }
.auth-grid { display: grid; grid-template-columns: 1fr 440px; min-height: 100vh; width: 100%; max-width: 1080px; margin: 0 auto; }
.auth-left { display: flex; flex-direction: column; justify-content: center; padding: 60px; }
.auth-left h2 { font-family: 'Sora', sans-serif; font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.auth-left p { color: var(--text-secondary); line-height: 1.7; }
.auth-feats { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.auth-feat { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.auth-feat-icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.auth-feat-text strong { display: block; font-size: .85rem; font-weight: 700; }
.auth-feat-text span { font-size: .78rem; color: var(--text-secondary); }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; box-shadow: var(--shadow-xl); }
.auth-card { width: 100%; }
.auth-header { margin-bottom: 28px; }
.auth-header h3 { font-family: 'Sora', sans-serif; font-size: 1.5rem; font-weight: 800; }
.auth-header p { font-size: .875rem; color: var(--text-secondary); margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-err { background: var(--error-bg); color: var(--error); padding: 10px 14px; border-radius: var(--radius); font-size: .85rem; display: none; }
.auth-link { text-align: center; font-size: .85rem; color: var(--text-secondary); margin-top: 16px; }
.auth-link a { color: var(--blue-600); font-weight: 600; cursor: pointer; text-decoration: none; }
.auth-demo { margin-top: 16px; padding: 12px 16px; background: var(--blue-50); border-radius: var(--radius); border: 1px solid var(--blue-100); }
.auth-demo .label { font-size: .72rem; font-weight: 700; color: var(--blue-600); margin-bottom: 4px; }
.auth-demo .creds { font-size: .8rem; color: var(--text-secondary); }

/* ============================================================
   APP SHELL
   ============================================================ */
#app { min-height: 100vh; background: var(--bg); }
.sidebar { width: var(--sidebar-w); height: 100vh; position: fixed; left: 0; top: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 200; }
.sidebar-logo { height: 64px; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px; }
.nav-section { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); padding: 14px 10px 5px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius); cursor: pointer; font-size: .875rem; font-weight: 500; color: var(--text-secondary); transition: all var(--t); margin-bottom: 1px; position: relative; }
.nav-item:hover { background: var(--bg-3); color: var(--text-primary); }
.nav-item.active { background: var(--blue-50); color: var(--blue-600); font-weight: 600; }
.nav-item .icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0; }
.nav-item.active .icon { background: var(--blue-100); }
.nav-item:hover:not(.active) .icon { background: var(--bg-3); }
.nav-pill { margin-left: auto; background: linear-gradient(135deg,var(--blue-500),var(--violet)); color: #fff; font-size: .6rem; font-weight: 800; padding: 2px 7px; border-radius: var(--radius-full); }
.sidebar-bottom { border-top: 1px solid var(--border); padding: 10px; flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: var(--radius); cursor: pointer; transition: background var(--t); }
.sidebar-user:hover { background: var(--bg-3); }
.user-ava { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg,var(--blue-500),var(--violet)); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.user-name { font-size: .82rem; font-weight: 700; line-height: 1.2; }
.user-role { font-size: .7rem; color: var(--text-tertiary); }
.user-plan-chip { margin-left: auto; background: var(--blue-50); color: var(--blue-600); font-size: .62rem; font-weight: 800; padding: 2px 7px; border-radius: var(--radius-full); }
.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
@media(max-width:1024px){ .app-main { margin-left: 0 !important; width: 100% !important; max-width: 100% !important; } }
.topbar { height: 64px; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 28px; position: sticky; top: 0; z-index: 100; gap: 14px; }
.topbar-title { font-family: 'Sora', sans-serif; font-size: 1.05rem; font-weight: 800; }
.topbar-search { flex: 1; max-width: 300px; margin-left: 14px; position: relative; }
.topbar-search input { width: 100%; padding: 8px 14px 8px 34px; border: 1.5px solid var(--border); border-radius: var(--radius-full); background: var(--bg-3); font-size: .83rem; color: var(--text-primary); outline: none; transition: all var(--t); }
.topbar-search input:focus { border-color: var(--blue-400); background: #fff; box-shadow: var(--shadow-glow); }
.topbar-search input::placeholder { color: var(--text-tertiary); }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: .82rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.page { display: none; flex: 1; padding: 28px; }
.page.active { display: block; }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-family: 'Sora', sans-serif; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.page-header p { font-size: .85rem; color: var(--text-secondary); margin-top: 3px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.welcome-card { background: linear-gradient(135deg,var(--blue-600) 0%,var(--violet) 100%); border-radius: var(--radius-xl); padding: 28px 32px; color: #fff; position: relative; overflow: hidden; margin-bottom: 22px; }
.welcome-card::before { content: ''; position: absolute; right: -30px; top: -30px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.07); }
.welcome-card::after { content: ''; position: absolute; left: 30%; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.04); }
.welcome-card h2 { font-family: 'Sora', sans-serif; font-size: 1.4rem; font-weight: 800; margin-bottom: 5px; position: relative; z-index: 1; }
.welcome-card p { font-size: .875rem; opacity: .85; position: relative; z-index: 1; }
.streak-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); padding: 5px 14px; border-radius: var(--radius-full); font-size: .78rem; font-weight: 700; margin-top: 14px; position: relative; z-index: 1; }

/* Stat cards — redesigned with colored left border */
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; box-shadow: var(--shadow-sm); transition: all var(--t); overflow: hidden; display: flex; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-accent { width: 4px; flex-shrink: 0; }
.stat-card-body { flex: 1; padding: 18px 20px; }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.stat-trend { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); }
.trend-up { background: var(--success-bg); color: var(--success); }
.stat-value { font-family: 'Sora', sans-serif; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .76rem; color: var(--text-secondary); margin-top: 4px; }

.dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.mini-item:last-child { border-bottom: none; }
.mini-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.mini-info { flex: 1; }
.mini-info strong { font-size: .85rem; font-weight: 600; display: block; }
.mini-info span { font-size: .72rem; color: var(--text-secondary); }
.mini-badge { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); }

/* ============================================================
   CHAT — Premium redesign
   ============================================================ */

/* Layout */
#page-chat { padding: 0; display: none; flex-direction: column; }
#page-chat.active { display: flex; }
.chat-shell { display: grid; grid-template-columns: 260px 1fr; height: calc(100vh - 64px); }

/* ── Sidebar ── */
.chat-left { border-right: 1px solid rgba(255,255,255,.06); background: #0f172a; display: flex; flex-direction: column; overflow: hidden; }
.chat-left-header { padding: 14px; border-bottom: 1px solid rgba(255,255,255,.07); flex-shrink: 0; }
.chat-left-header .btn-primary { background: rgba(99,102,241,.2); border: 1px solid rgba(99,102,241,.35); box-shadow: none; }
.chat-left-header .btn-primary:hover { background: rgba(99,102,241,.32); }
.chat-history { flex: 1; overflow-y: auto; padding: 8px 6px; }
.chat-history::-webkit-scrollbar { width: 3px; }
.chat-history::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }
.chi-section { font-size: .6rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.28); padding: 14px 9px 5px; }
.chi { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: .8rem; font-weight: 500; color: rgba(255,255,255,.6); transition: all var(--t); margin-bottom: 1px; position: relative; }
.chi:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.chi.active { background: rgba(99,102,241,.22); color: #fff; font-weight: 600; }
.chi.active::before { content:''; position:absolute; left:0; top:18%; height:64%; width:2.5px; background:var(--blue-500); border-radius:0 2px 2px 0; }
.chi-icon { width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.07); display: flex; align-items: center; justify-content: center; font-size: .78rem; flex-shrink: 0; color: rgba(255,255,255,.5); }
.chi.active .chi-icon { background: rgba(99,102,241,.28); color: #818cf8; }
.chi-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chi-del { opacity: 0; width: 22px; height: 22px; border-radius: 6px; background: rgba(239,68,68,.12); color: #fca5a5; display: flex; align-items: center; justify-content: center; font-size: .72rem; cursor: pointer; border: none; transition: opacity var(--t); flex-shrink: 0; }
.chi:hover .chi-del { opacity: 1; }
.chi-del:hover { background: rgba(239,68,68,.28) !important; }

/* ── Chat main area ── */
.chat-main { display: flex; flex-direction: column; background: #f8f9fc; }
.chat-header-bar { padding: 12px 24px; border-bottom: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.chat-ai-info { display: flex; align-items: center; gap: 10px; }
.ai-status-badge { display: flex; align-items: center; gap: 7px; padding: 5px 13px; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius-full); }
.ai-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.2); animation: pulse-online 2s infinite; }
@keyframes pulse-online { 0%,100%{box-shadow:0 0 0 2px rgba(16,185,129,.15)}50%{box-shadow:0 0 0 5px rgba(16,185,129,.05)} }
.ai-status-txt { font-size: .73rem; font-weight: 700; color: var(--blue-600); }
.mode-pills { display: flex; gap: 5px; }
.mode-pill { display: flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: var(--radius-full); font-size: .76rem; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border); color: var(--text-secondary); background: white; transition: all var(--t); }
.mode-pill:hover { border-color: var(--blue-400); color: var(--blue-600); background: var(--blue-50); }
.mode-pill.active { background: linear-gradient(135deg,var(--blue-600),var(--violet)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.25); }

/* ── Messages ── */
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; scroll-behavior: smooth; }
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.msg-group { display: flex; flex-direction: column; padding: 14px 24px; transition: background var(--t); }
.msg-group.ai:hover { background: rgba(99,102,241,.025); }
.msg-group.user { align-items: flex-end; }
.msg-group { animation: msgIn .25s cubic-bezier(.4,0,.2,1) both; }
@keyframes msgIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.msg-row { display: flex; gap: 14px; max-width: 840px; width: 100%; margin: 0 auto; }
.msg-group.user .msg-row { justify-content: flex-end; }

.ai-ava-wrap { flex-shrink: 0; margin-top: 2px; }
.msg-ava { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; }
.ai-ava { background: linear-gradient(135deg,var(--blue-600),var(--violet)); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.28); }
.user-ava { background: linear-gradient(135deg,#1e293b,#334155); color: #fff; }

.ai-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ai-name { font-size: .79rem; font-weight: 700; color: var(--text-primary); }
.ai-model-badge { font-size: .64rem; font-weight: 700; padding: 2px 8px; background: var(--blue-50); color: var(--blue-600); border-radius: var(--radius-full); border: 1px solid var(--blue-100); }

.msg-content { flex: 1; min-width: 0; }
.msg-group.user .msg-content { display: flex; flex-direction: column; align-items: flex-end; }

.msg-bubble { border-radius: 16px; font-size: .9rem; line-height: 1.8; word-break: break-word; }
.user-bubble { background: linear-gradient(135deg,var(--blue-600),var(--blue-700)); color: #fff; padding: 13px 18px; border-radius: 20px 20px 4px 20px; box-shadow: 0 4px 18px rgba(79,70,229,.28); white-space: pre-wrap; max-width: 72%; display: inline-block; }
.ai-bubble { background: transparent; color: var(--text-primary); padding: 0; }
.ai-bubble p { margin-bottom: 11px; line-height: 1.82; color: #1e293b; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble ul,.ai-bubble ol { padding-left: 22px; margin: 10px 0; }
.ai-bubble li { margin-bottom: 6px; line-height: 1.75; color: #1e293b; }
.ai-bubble strong { font-weight: 700; color: var(--text-primary); }
.ai-bubble em { font-style: italic; color: var(--text-secondary); }
.ai-bubble .md-h1 { font-family:'Sora',sans-serif; font-size:1.3rem; font-weight:800; margin:22px 0 10px; color:var(--text-primary); padding-bottom:8px; border-bottom:2px solid var(--border); }
.ai-bubble .md-h2 { font-family:'Sora',sans-serif; font-size:1.1rem; font-weight:700; margin:18px 0 8px; color:var(--text-primary); }
.ai-bubble .md-h3 { font-size:1rem; font-weight:700; margin:14px 0 6px; color:var(--blue-600); }
.ai-bubble .md-bq { border-left:3px solid var(--blue-400); padding:10px 16px; margin:14px 0; background:var(--blue-50); border-radius:0 10px 10px 0; color:var(--text-secondary); font-style:italic; }
.ai-bubble .md-hr { border:none; border-top:1.5px solid var(--border); margin:18px 0; }
.ai-bubble .inline-code { background:#f1f5f9; color:var(--blue-700); border:1px solid var(--blue-100); padding:2px 7px; border-radius:5px; font-family:'Courier New',monospace; font-size:.83em; font-weight:600; }
.ai-bubble .code-block { background:#0f172a; border-radius:12px; padding:18px 20px; margin:14px 0; overflow-x:auto; position:relative; border:1px solid #1e293b; }
.ai-bubble .code-block code { color:#e2e8f0; font-family:'Courier New',monospace; font-size:.83rem; line-height:1.65; }
.code-copy-btn { position:absolute; top:10px; right:10px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); color:#94a3b8; padding:4px 10px; border-radius:6px; font-size:.71rem; cursor:pointer; display:flex; align-items:center; gap:5px; font-family:inherit; transition:all var(--t); }
.code-copy-btn:hover { background:rgba(255,255,255,.16); color:#fff; }

.msg-att-chip { display:inline-flex; align-items:center; gap:6px; padding:5px 11px; background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.22); border-radius:8px; font-size:.75rem; font-weight:600; margin-bottom:8px; color:#fff; }

.msg-ts { font-size:.67rem; color:var(--text-tertiary); margin-top:7px; }
.msg-actions-row { display:flex; align-items:center; justify-content:space-between; margin-top:9px; opacity:0; transition:opacity var(--t); }
.msg-group.ai:hover .msg-actions-row { opacity:1; }
.msg-actions { display:flex; gap:4px; }
.msg-action-btn { width:28px; height:28px; border-radius:7px; border:1.5px solid var(--border); background:white; color:var(--text-tertiary); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all var(--t); }
.msg-action-btn:hover { border-color:var(--blue-400); color:var(--blue-600); background:var(--blue-50); }

/* Typing */
.typing-indicator { display:flex; align-items:center; gap:5px; padding:2px 0; }
.typing-dot { width:7px; height:7px; border-radius:50%; background:var(--blue-400); animation:typing-bounce 1.3s infinite; opacity:.6; }
.typing-dot:nth-child(2) { animation-delay:.18s; }
.typing-dot:nth-child(3) { animation-delay:.36s; }
@keyframes typing-bounce { 0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-7px);opacity:1} }

/* ── Input zone ── */
.chat-input-zone { padding:14px 24px 18px; background:#fff; border-top:1px solid var(--border); flex-shrink:0; }
.chat-hints { display:flex; gap:7px; margin-bottom:10px; flex-wrap:wrap; }
.hint-chip { padding:5px 13px; border-radius:var(--radius-full); background:var(--surface); border:1.5px solid var(--border); font-size:.77rem; font-weight:600; color:var(--text-secondary); cursor:pointer; transition:all var(--t); display:flex; align-items:center; gap:5px; }
.hint-chip:hover { border-color:var(--blue-400); color:var(--blue-600); background:var(--blue-50); transform:translateY(-1px); }
.chat-input-row { display:flex; gap:10px; align-items:flex-end; }
.chat-input-inner { flex:1; display:flex; flex-direction:column; background:#f8f9fc; border:1.5px solid var(--border); border-radius:var(--radius-lg); padding:11px 14px; transition:all var(--t); }
.chat-input-inner:focus-within { border-color:var(--blue-500); box-shadow:0 0 0 3px rgba(99,102,241,.1); background:#fff; }
.chat-textarea { border:none; background:none; outline:none; resize:none; font-size:.9rem; line-height:1.55; color:var(--text-primary); min-height:26px; max-height:150px; font-family:'Plus Jakarta Sans',sans-serif; }
.chat-textarea::placeholder { color:var(--text-tertiary); }
.chat-actions { display:flex; gap:6px; margin-top:8px; align-items:center; }
.attach-btn { width:30px; height:30px; border-radius:8px; background:var(--bg-3); border:1.5px solid var(--border); color:var(--text-secondary); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all var(--t); font-size:.9rem; }
.attach-btn:hover { border-color:var(--blue-400); color:var(--blue-600); background:var(--blue-50); }
.send-btn { width:38px; height:38px; border-radius:var(--radius); background:linear-gradient(135deg,var(--blue-600),var(--blue-500)); border:none; color:#fff; font-size:1rem; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all var(--t); box-shadow:0 2px 8px rgba(79,70,229,.25); flex-shrink:0; }
.send-btn:hover { transform:scale(1.06); box-shadow:0 4px 16px rgba(79,70,229,.35); }
.send-btn:disabled { opacity:.45; cursor:not-allowed; transform:none; }
.ai-limit-bar { font-size:.7rem; color:var(--text-tertiary); text-align:right; margin-top:7px; }
.attachment-preview { display:flex; align-items:center; gap:11px; padding:9px 14px; background:var(--blue-50); border:1.5px solid var(--blue-100); border-radius:var(--radius); margin-bottom:9px; }
.attachment-preview img { width:52px; height:52px; object-fit:cover; border-radius:8px; flex-shrink:0; }
.att-file-icon { width:52px; height:52px; background:rgba(99,102,241,.1); border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:1.5rem; flex-shrink:0; }
.attachment-info { flex:1; min-width:0; }
.attachment-name { font-size:.82rem; font-weight:700; color:var(--blue-600); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.attachment-size { font-size:.72rem; color:var(--text-secondary); margin-top:1px; }
.attachment-remove { width:24px; height:24px; border-radius:6px; background:rgba(239,68,68,.1); border:1px solid rgba(239,68,68,.15); color:var(--error); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:.8rem; flex-shrink:0; transition:all var(--t); }
.attachment-remove:hover { background:rgba(239,68,68,.2); }

/* ============================================================
   MATERIALS
   ============================================================ */
.material-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: all var(--t); box-shadow: var(--shadow-sm); }
.material-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.mat-thumb { height: 90px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.mat-body { padding: 16px; }
.mat-type { font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 5px; }
.mat-body h4 { font-size: .88rem; font-weight: 700; margin-bottom: 5px; }
.mat-body p { font-size: .78rem; color: var(--text-secondary); line-height: 1.5; }
.mat-actions { display: flex; gap: 6px; margin-top: 10px; }
.material-viewer { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 32px; max-height: 75vh; overflow-y: auto; }
.material-viewer h1, .material-viewer h2, .material-viewer h3 { font-family: 'Sora', sans-serif; font-weight: 700; margin: 16px 0 8px; color: var(--text-primary); }
.material-viewer h1 { font-size: 1.5rem; }
.material-viewer h2 { font-size: 1.2rem; }
.material-viewer h3 { font-size: 1rem; }
.material-viewer p { margin-bottom: 10px; line-height: 1.7; color: var(--text-secondary); }
.material-viewer ul, .material-viewer ol { padding-left: 20px; margin: 8px 0; }
.material-viewer li { margin-bottom: 5px; color: var(--text-secondary); }
.material-viewer strong { font-weight: 700; color: var(--text-primary); }
.material-viewer code { background: var(--blue-50); color: var(--blue-600); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: .85em; }
.material-viewer blockquote { border-left: 4px solid var(--blue-400); padding: 10px 16px; background: var(--blue-50); border-radius: 0 var(--radius) var(--radius) 0; margin: 12px 0; }
.material-viewer hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: all var(--t); box-shadow: var(--shadow-sm); }
.quiz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.quiz-card-top { height: 5px; }
.quiz-card-body { padding: 20px; }
.quiz-subject { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 7px; }
.quiz-card h3 { font-size: .92rem; font-weight: 700; margin-bottom: 7px; }
.quiz-card p { font-size: .8rem; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }
.quiz-footer { display: flex; gap: 10px; font-size: .73rem; color: var(--text-tertiary); }
.qa-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.qa-prog-bar { height: 5px; background: var(--bg-3); border-radius: 99px; flex: 1; margin: 0 14px; }
.qa-prog-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg,var(--blue-500),var(--violet)); transition: width .5s ease; }
.qa-question { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.qa-question h2 { font-family: 'Sora', sans-serif; font-size: 1.2rem; font-weight: 700; line-height: 1.4; }
.qa-options { display: flex; flex-direction: column; gap: 9px; }
.qa-option { display: flex; align-items: center; gap: 12px; background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 13px 17px; cursor: pointer; font-size: .875rem; font-weight: 500; transition: all var(--t); }
.qa-option:hover { border-color: var(--blue-400); background: var(--blue-50); color: var(--blue-700); }
.qa-option.correct { border-color: var(--success); background: var(--success-bg); color: #065f46; }
.qa-option.wrong { border-color: var(--error); background: var(--error-bg); color: #7f1d1d; }
.opt-letter { width: 26px; height: 26px; border-radius: 7px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: .76rem; font-weight: 800; flex-shrink: 0; }
.qa-option.correct .opt-letter { background: var(--success); color: #fff; }
.qa-option.wrong .opt-letter { background: var(--error); color: #fff; }
.qa-explanation { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius); padding: 14px; margin-top: 12px; font-size: .85rem; color: var(--text-secondary); line-height: 1.6; display: none; }

/* ============================================================
   FLASHCARDS
   ============================================================ */
.deck-card { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 20px; cursor: pointer; transition: all var(--t); box-shadow: var(--shadow-sm); }
.deck-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #93c5fd; }
.deck-emoji { font-size: 1.8rem; margin-bottom: 10px; }
.deck-card h4 { font-size: .88rem; font-weight: 700; margin-bottom: 3px; }
.deck-card p { font-size: .76rem; color: var(--text-secondary); }
.deck-count { margin-top: 12px; font-size: .73rem; font-weight: 700; color: var(--blue-600); background: var(--blue-50); padding: 2px 9px; border-radius: var(--radius-full); display: inline-block; }
.fc-wrap { max-width: 540px; margin: 0 auto; }
.fc-card { perspective: 1200px; height: 270px; cursor: pointer; margin-bottom: 18px; }
.fc-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4,0,.2,1); }
.fc-card.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius-xl); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px; text-align: center; }
.fc-front { background: #fff; border: 1.5px solid var(--border); box-shadow: var(--shadow-md); }
.fc-back { background: linear-gradient(135deg,var(--blue-600),var(--violet)); color: #fff; transform: rotateY(180deg); }
.fc-face-label { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; opacity: .6; }
.fc-front h2 { font-family: 'Sora', sans-serif; font-size: 1.4rem; font-weight: 800; }
.fc-back p { font-size: .92rem; line-height: 1.65; }
.fc-buttons { display: flex; gap: 9px; justify-content: center; }
.fc-btn { padding: 9px 22px; border-radius: var(--radius-full); font-size: .85rem; font-weight: 700; cursor: pointer; transition: all var(--t); border: none; }
.fc-btn-wrong { background: var(--error-bg); color: var(--error); }
.fc-btn-hard { background: var(--warning-bg); color: var(--warning); }
.fc-btn-easy { background: var(--success-bg); color: var(--success); }

/* ============================================================
   PROGRESS & HEATMAP
   ============================================================ */
.heatmap { display: grid; grid-template-columns: repeat(26,1fr); gap: 3px; margin-top: 14px; }
.hc { aspect-ratio: 1; border-radius: 3px; background: var(--bg-3); transition: transform var(--t); }
.hc:hover { transform: scale(1.3); }
.hc.l1 { background: #c7d2fe; }
.hc.l2 { background: #a5b4fc; }
.hc.l3 { background: var(--blue-400); }
.hc.l4 { background: var(--blue-600); }
.bar-chart { display: flex; align-items: flex-end; gap: 5px; height: 90px; margin-top: 14px; }
.bar { flex: 1; border-radius: 5px 5px 0 0; background: linear-gradient(to top,var(--blue-500),var(--blue-400)); opacity: .8; transition: opacity var(--t); min-height: 3px; }
.bar:hover { opacity: 1; }

/* ============================================================
   PROFILE & ADMIN
   ============================================================ */
.profile-hero { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 26px 30px; display: flex; align-items: center; gap: 22px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.profile-ava-lg { width: 68px; height: 68px; border-radius: var(--radius-lg); background: linear-gradient(135deg,var(--blue-600),var(--violet)); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.tbl-head, .tbl-row { display: grid; grid-template-columns: 2.5fr 1fr 1fr 1fr 1fr; padding: 11px 18px; align-items: center; }
.tbl-head { background: var(--bg-3); border-bottom: 1px solid var(--border); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }
.tbl-row { border-bottom: 1px solid var(--border); transition: background var(--t); font-size: .83rem; }
.tbl-row:last-child { border-bottom: none; }
.tbl-row:hover { background: var(--bg-3); }
.tbl-user { display: flex; align-items: center; gap: 9px; }
.tbl-ava { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; color: #fff; }
.filter-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-tab { padding: 6px 15px; border-radius: var(--radius-full); border: 1.5px solid var(--border); font-size: .8rem; font-weight: 600; cursor: pointer; background: #fff; color: var(--text-secondary); transition: all var(--t); }
.filter-tab:hover { border-color: var(--blue-400); color: var(--blue-600); }
.filter-tab.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* ============================================================
   WIZARD — STUDY PLAN
   ============================================================ */

/* ── Layout base ── */
#page-plan { padding: 0; overflow-x: hidden; }

/* ── Top progress bar ── */
.wiz-topbar {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 28px;
}
.wiz-topbar-inner {
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 20px;
}
.wiz-steps-label { font-size: .75rem; font-weight: 700; color: var(--text-tertiary); white-space: nowrap; }
.wiz-steps-label span { color: var(--blue-600); }
.wiz-progress-track { flex: 1; height: 6px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.wiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--violet));
  border-radius: 99px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.wiz-back-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; color: var(--text-secondary);
  transition: all var(--t); flex-shrink: 0;
}
.wiz-back-btn:hover { background: var(--border); color: var(--text-primary); }
.wiz-back-btn:disabled { opacity: 0; pointer-events: none; }

/* ── Step container ── */
.wizard-container { max-width: 680px; margin: 0 auto; padding: 44px 28px 80px; width: 100%; }

.wizard-step { display: none; }
.wizard-step.active {
  display: block;
  animation: wizSlideIn .32s cubic-bezier(.4,0,.2,1) both;
}
.wizard-step.exit-left  { animation: wizSlideLeft  .22s cubic-bezier(.4,0,.2,1) both; }
.wizard-step.exit-right { animation: wizSlideRight .22s cubic-bezier(.4,0,.2,1) both; }

@keyframes wizSlideIn    { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@keyframes wizSlideLeft  { from { opacity:1; transform:translateX(0);    } to { opacity:0; transform:translateX(-40px); } }
@keyframes wizSlideRight { from { opacity:1; transform:translateX(0);    } to { opacity:0; transform:translateX(40px);  } }

/* ── Step typography ── */
.wiz-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue-500); margin-bottom: 10px;
}
.wiz-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--blue-500);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }

.wizard-step h2 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800; line-height: 1.2; letter-spacing: -.025em;
  color: var(--text-primary); margin-bottom: 10px;
}
.wizard-step p.sub {
  font-size: .95rem; color: var(--text-secondary);
  line-height: 1.65; margin-bottom: 32px; max-width: 520px;
}

/* ── Welcome step ── */
.wiz-welcome-art {
  width: 120px; height: 120px; margin: 0 auto 28px;
  background: linear-gradient(135deg, var(--blue-100), var(--violet-soft));
  border-radius: 32px; display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  box-shadow: 0 8px 32px rgba(99,102,241,.18);
  animation: float-y 4s ease-in-out infinite;
}
@keyframes float-y { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.wiz-welcome-stats {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin: 28px 0;
}
.wiz-stat-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-full); font-size: .82rem; font-weight: 600;
  box-shadow: var(--shadow-sm); color: var(--text-secondary);
}

/* ── Option cards ── */
.wizard-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wizard-options.cols-3 { grid-template-columns: repeat(3,1fr); }

.wiz-opt {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 20px; border: 2px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer;
  transition: all var(--t); background: #fff; user-select: none;
  position: relative;
}
.wiz-opt:hover { border-color: var(--blue-400); background: var(--blue-50); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.wiz-opt.selected {
  border-color: var(--blue-500); background: var(--blue-50);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12), var(--shadow-md);
  transform: translateY(-2px);
}
.wiz-opt-icon { font-size: 1.7rem; flex-shrink: 0; margin-top: 1px; line-height: 1; }
.wiz-opt-text { flex: 1; min-width: 0; }
.wiz-opt-text strong { display: block; font-size: .925rem; font-weight: 700; margin-bottom: 3px; color: var(--text-primary); }
.wiz-opt-text span { font-size: .78rem; color: var(--text-secondary); line-height: 1.4; }
.wiz-opt-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--t); margin-top: 1px;
}
.wiz-opt.selected .wiz-opt-check {
  background: var(--blue-500); border-color: var(--blue-500);
  color: #fff; font-size: .72rem; font-weight: 800;
}
/* Nivel centered layout */
.wiz-opt.centered {
  flex-direction: column; align-items: center; text-align: center;
  padding: 28px 16px; gap: 10px;
}
.wiz-opt.centered .wiz-opt-icon { font-size: 2.6rem; margin-top: 0; }
.wiz-opt.centered .wiz-opt-check { display: none; }
.wiz-opt.centered.selected { background: linear-gradient(135deg, var(--blue-50), var(--violet-soft)); }

/* ── Matérias — chips ── */
.wizard-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.wiz-chip {
  padding: 8px 18px; border-radius: var(--radius-full);
  border: 2px solid var(--border); font-size: .865rem; font-weight: 600;
  cursor: pointer; transition: all var(--t); background: #fff; color: var(--text-secondary);
}
.wiz-chip:hover { border-color: var(--blue-400); color: var(--blue-600); background: var(--blue-50); transform: translateY(-1px); }
.wiz-chip.selected {
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue-600), var(--violet));
  color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.wizard-custom-input { display: flex; gap: 10px; }
.selected-count-pill {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 5px 14px;
  background: var(--success-bg); border: 1px solid rgba(16,185,129,.2);
  border-radius: var(--radius-full); font-size: .8rem; font-weight: 700; color: var(--success);
}

/* ── Horas — slider ── */
.hours-display-wrap { text-align: center; margin: 24px 0 8px; }
.hours-display {
  font-family: 'Sora', sans-serif; font-size: 4.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--blue-600), var(--violet));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1;
}
.hours-sub { font-size: .9rem; color: var(--text-secondary); margin-top: 4px; }
.hours-slider-wrap { padding: 8px 4px; }
.hours-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 10px; border-radius: 99px;
  background: var(--border); outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--blue-500) 0%, var(--border) 0%);
}
.hours-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; border: 3px solid var(--blue-600); cursor: pointer;
  box-shadow: 0 2px 10px rgba(79,70,229,.35); transition: transform var(--t);
}
.hours-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.hours-ticks { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-tertiary); margin-top: 6px; padding: 0 4px; }
.hours-tip {
  margin-top: 22px; padding: 14px 18px;
  background: linear-gradient(135deg, var(--blue-50), var(--violet-soft));
  border: 1px solid var(--blue-100); border-radius: var(--radius-lg);
  font-size: .875rem; color: var(--text-secondary); line-height: 1.6;
  transition: all .4s ease;
}

/* ── Dias da semana — DESTAQUE ── */
.weekday-intro {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: var(--warning-bg);
  border: 1px solid rgba(245,158,11,.25); border-radius: var(--radius-lg);
  margin-bottom: 24px; font-size: .875rem; color: #92400e; font-weight: 600;
}
.weekday-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 10px; margin-bottom: 20px; }
.wiz-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 6px 12px; border: 2px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer;
  transition: all var(--t); background: #fff; gap: 7px;
  user-select: none; position: relative;
}
.wiz-day:hover { border-color: var(--blue-400); background: var(--blue-50); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.wiz-day.selected {
  border-color: transparent;
  background: linear-gradient(150deg, var(--blue-600), var(--violet));
  color: #fff; transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(99,102,241,.35);
}
.wiz-day .day-abbr { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.wiz-day .day-icon { font-size: 1.4rem; line-height: 1; }
.wiz-day .day-num { font-size: .65rem; font-weight: 700; opacity: .65; }
.wiz-day.selected .day-abbr,
.wiz-day.selected .day-num { color: rgba(255,255,255,.85); }
.wiz-day .day-check {
  position: absolute; top: 6px; right: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,.9); display: none;
  align-items: center; justify-content: center;
  font-size: .55rem; color: var(--blue-600); font-weight: 900;
}
.wiz-day.selected .day-check { display: flex; }

.dias-summary {
  padding: 14px 18px;
  background: var(--bg-3); border-radius: var(--radius-lg);
  font-size: .875rem; color: var(--text-secondary);
  min-height: 52px; transition: all .3s ease;
}
.dias-summary.has-selection {
  background: var(--success-bg); border: 1px solid rgba(16,185,129,.2);
  color: #065f46; font-weight: 600;
}

/* ── Date & obs ── */
.date-optional { font-size: .78rem; color: var(--text-tertiary); margin-top: 6px; }
.skip-link {
  font-size: .82rem; color: var(--text-tertiary); cursor: pointer;
  text-decoration: underline; text-decoration-style: dashed; margin-top: 10px; display: inline-block;
}
.skip-link:hover { color: var(--text-secondary); }

/* ── Confirmação ── */
.confirm-header-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; background: var(--success-bg);
  border: 1px solid rgba(16,185,129,.2); border-radius: var(--radius-full);
  font-size: .82rem; font-weight: 700; color: var(--success); margin-bottom: 24px;
}
.confirm-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.confirm-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; background: #fff;
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  transition: all var(--t);
}
.confirm-row:hover { border-color: var(--blue-200, #bfdbfe); background: var(--blue-50); }
.confirm-icon { font-size: 1.3rem; flex-shrink: 0; }
.confirm-content { flex: 1; }
.confirm-label { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-tertiary); margin-bottom: 2px; }
.confirm-value { font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.confirm-edit { font-size: .75rem; color: var(--blue-500); cursor: pointer; font-weight: 600; flex-shrink: 0; }
.confirm-edit:hover { text-decoration: underline; }

.gen-btn-wrap { position: relative; }
.gen-btn-wrap .btn-primary { font-size: 1rem; padding: 16px 32px; width: 100%; justify-content: center; border-radius: var(--radius-lg); }
.gen-btn-glow {
  position: absolute; inset: -3px; border-radius: 18px;
  background: linear-gradient(135deg, var(--blue-500), var(--violet));
  opacity: .35; filter: blur(10px); z-index: -1;
  animation: glow-pulse 2s ease-in-out infinite;
}
@keyframes glow-pulse { 0%,100%{opacity:.35;transform:scale(1)} 50%{opacity:.55;transform:scale(1.02)} }

/* ── Wizard footer nav ── */
.wizard-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════
   PLAN RESULT — gerado pela IA
═══════════════════════════════════════════════ */
.plan-result { padding: 0; animation: wizSlideIn .4s ease both; }

/* Header */
.plan-hero {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500) 50%, var(--violet));
  padding: 32px 32px 28px; color: #fff; position: relative; overflow: hidden;
}
.plan-hero::before {
  content:''; position:absolute; right:-40px; top:-40px;
  width:220px; height:220px; border-radius:50%; background:rgba(255,255,255,.06);
}
.plan-hero::after {
  content:''; position:absolute; left:40%; bottom:-60px;
  width:180px; height:180px; border-radius:50%; background:rgba(255,255,255,.04);
}
.plan-hero-content { position:relative; z-index:1; max-width:720px; margin:0 auto; }
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  margin-bottom: 14px;
}
.plan-hero h2 { font-family: 'Sora', sans-serif; font-size: 1.55rem; font-weight: 800; line-height: 1.25; margin-bottom: 10px; }
.plan-hero p { font-size: .9rem; opacity: .85; line-height: 1.6; margin-bottom: 16px; }
.plan-ai-msg {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-lg); padding: 14px 18px;
  font-size: .875rem; line-height: 1.65; display: flex; gap: 10px; align-items: flex-start;
}
.plan-ai-msg .ai-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.plan-meta-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; align-items: center;
}
.plan-chip {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: .78rem; font-weight: 600;
}

/* Body */
.plan-body { padding: 28px 32px; max-width: 1100px; margin: 0 auto; }

/* Week overview strip */
.week-overview {
  display: flex; gap: 8px; margin-bottom: 28px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  box-shadow: var(--shadow-sm); overflow-x: auto;
}
.wov-day {
  flex: 1; min-width: 70px; display: flex; flex-direction: column;
  align-items: center; gap: 5px;
}
.wov-dot {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 800; text-transform: uppercase;
  border: 2px solid var(--border); color: var(--text-tertiary);
  background: var(--bg-3); transition: all var(--t);
}
.wov-dot.active {
  background: linear-gradient(135deg, var(--blue-600), var(--violet));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.3);
}
.wov-label { font-size: .65rem; color: var(--text-tertiary); font-weight: 700; }
.wov-count { font-size: .62rem; color: var(--text-tertiary); }
.wov-count.active { color: var(--blue-600); font-weight: 700; }

/* Progress bar strip */
.plan-progress-wrap { margin-bottom: 28px; }
.plan-progress-label { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 6px; }
.plan-progress-label strong { color: var(--text-primary); }
.plan-progress-bar { height: 8px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.plan-progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue-500), var(--violet)); transition: width 1.5s cubic-bezier(.4,0,.2,1); }

/* Section title */
.plan-section-title {
  font-family: 'Sora', sans-serif; font-size: .95rem; font-weight: 800;
  color: var(--text-primary); margin-bottom: 16px; margin-top: 28px;
  display: flex; align-items: center; gap: 8px;
}
.plan-section-title::after {
  content:''; flex:1; height:1px; background:var(--border);
}

/* Day cards grid */
.day-cards-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }

.day-card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: all var(--t);
}
.day-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.day-card-header {
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.day-card.active-day .day-card-header {
  background: linear-gradient(90deg, rgba(99,102,241,.06), rgba(124,58,237,.04));
}
.day-card-header .day-name { font-family: 'Sora', sans-serif; font-size: .9rem; font-weight: 800; }
.day-card-header .day-time {
  font-size: .73rem; font-weight: 700; color: var(--blue-600);
  background: var(--blue-50); padding: 2px 9px; border-radius: var(--radius-full);
}
.day-card.rest-day { opacity: .65; }
.day-card.rest-day .day-card-header { background: var(--bg-3); }

.session-pill {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  transition: background var(--t); cursor: default;
}
.session-pill:last-child { border-bottom: none; }
.session-pill:hover { background: var(--blue-50); }
.pill-color { width: 4px; align-self: stretch; border-radius: 99px; flex-shrink: 0; min-height: 34px; }
.pill-info { flex: 1; min-width: 0; }
.pill-subject { font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.pill-topic { font-size: .73rem; color: var(--text-secondary); margin-top: 1px; }
.pill-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.pill-mins { font-size: .73rem; font-weight: 800; color: var(--blue-600); }

.tipo-badge {
  font-size: .62rem; font-weight: 800; padding: 2px 8px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: .04em;
}
.tipo-teoria      { background:#e0f2fe; color:#0369a1; }
.tipo-exercicios  { background:#fef3c7; color:#92400e; }
.tipo-revisao     { background:#d1fae5; color:#065f46; }
.tipo-simulado    { background:#ede9fe; color:#5b21b6; }
.tipo-mapaMental  { background:#fce7f3; color:#9d174d; }

/* Dicas */
.dicas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dica-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  font-size: .875rem; color: var(--text-secondary); line-height: 1.6;
  display: flex; gap: 12px; transition: all var(--t);
  box-shadow: var(--shadow-sm);
}
.dica-card:hover { border-color: var(--blue-300,#93c5fd); background: var(--blue-50); }
.dica-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }

/* Plan actions */
.plan-actions-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .day-cards-grid { grid-template-columns: 1fr; }
  .wizard-options { grid-template-columns: 1fr; }
  .wizard-options.cols-3 { grid-template-columns: 1fr 1fr; }
  .weekday-grid { grid-template-columns: repeat(4,1fr); }
  .plan-body { padding: 22px 18px; }
  .plan-hero { padding: 24px 18px; }
}
@media (max-width: 640px) {
  .features-grid { grid-template-columns: 1fr; }
  .wizard-container { padding: 24px 16px 72px; }
  .weekday-grid { grid-template-columns: repeat(4,1fr); gap: 7px; }
  .dicas-grid { grid-template-columns: 1fr; }
  .day-cards-grid { grid-template-columns: 1fr; }
  .wizard-options.cols-3 { grid-template-columns: 1fr; }
  .week-overview { gap: 5px; padding: 12px 14px; }
  .wov-dot { width: 34px; height: 34px; }
}

/* ============================================================
   ADDITIONS & IMPROVEMENTS — dashboard, quiz, flashcards, progress
   ============================================================ */

/* ── Dashboard stat cards (dynamic) ── */
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); transition: all var(--t); position: relative; overflow: hidden; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.stat-value { font-family: 'Sora', sans-serif; font-size: 1.85rem; font-weight: 800; line-height: 1; margin-bottom: 3px; }
.stat-label { font-size: .79rem; color: var(--text-secondary); font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }

/* ── Welcome card ── */
.welcome-card { background: linear-gradient(135deg, var(--blue-600), var(--violet)); border-radius: var(--radius-xl); padding: 28px 32px; color: #fff; position: relative; overflow: hidden; margin-bottom: 22px; }
.welcome-card::before { content: ''; position: absolute; right: -20px; top: -20px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.07); }
.welcome-card::after  { content: ''; position: absolute; left: 40%; bottom: -50px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.04); }
.welcome-card h2 { font-family: 'Sora', sans-serif; font-size: 1.4rem; font-weight: 800; margin-bottom: 5px; position: relative; z-index: 1; }
.welcome-card p  { font-size: .875rem; opacity: .85; position: relative; z-index: 1; }
.streak-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); padding: 4px 12px; border-radius: var(--radius-full); font-size: .78rem; font-weight: 700; margin-top: 14px; position: relative; z-index: 1; }

/* ── Mini items (sessions, exams) ── */
.mini-item { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.mini-item:last-child { border-bottom: none; }
.mini-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .88rem; flex-shrink: 0; }
.mini-info { flex: 1; min-width: 0; }
.mini-info strong { font-size: .855rem; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-info span { font-size: .73rem; color: var(--text-secondary); }

/* ── Materials ── */
.material-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: all var(--t); box-shadow: var(--shadow-sm); }
.material-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-200, #bfdbfe); }
.mat-thumb { height: 90px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.mat-body { padding: 16px; }
.mat-type { font-size: .64rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 5px; }
.mat-body h4 { font-size: .88rem; font-weight: 700; margin-bottom: 5px; color: var(--text-primary); }
.mat-body p { font-size: .77rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }
.mat-actions { display: flex; gap: 6px; }
.material-viewer { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 28px 32px; max-height: 72vh; overflow-y: auto; line-height: 1.75; }
.material-viewer h1,.material-viewer h2,.material-viewer h3 { font-family: 'Sora',sans-serif; font-weight: 700; margin: 16px 0 8px; color: var(--text-primary); }
.material-viewer h1 { font-size: 1.45rem; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.material-viewer h2 { font-size: 1.15rem; } .material-viewer h3 { font-size: 1rem; }
.material-viewer p { margin-bottom: 10px; color: var(--text-secondary); }
.material-viewer ul,.material-viewer ol { padding-left: 20px; margin: 8px 0; }
.material-viewer li { margin-bottom: 5px; color: var(--text-secondary); }
.material-viewer strong { font-weight: 700; color: var(--text-primary); }
.material-viewer .inline-code,.material-viewer code { background: var(--blue-50); color: var(--blue-700); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: .85em; border: 1px solid var(--blue-100); }
.material-viewer .code-block,.material-viewer pre { background: #0f172a; color: #e2e8f0; padding: 16px 18px; border-radius: 10px; overflow-x: auto; margin: 12px 0; font-family: 'Courier New',monospace; font-size: .83rem; line-height: 1.6; }
.material-viewer blockquote,.material-viewer .md-bq { border-left: 4px solid var(--blue-400); padding: 10px 16px; background: var(--blue-50); border-radius: 0 var(--radius) var(--radius) 0; margin: 12px 0; color: var(--text-secondary); font-style: italic; }
.material-viewer hr,.material-viewer .md-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Quiz ── */
.quiz-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: all var(--t); box-shadow: var(--shadow-sm); }
.quiz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-300, #93c5fd); }
.quiz-card-top { height: 5px; }
.quiz-card-body { padding: 18px 20px; }
.quiz-subject { font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 6px; }
.quiz-card h3 { font-size: .92rem; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }
.quiz-card p { font-size: .79rem; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.5; }
.quiz-footer { display: flex; align-items: center; justify-content: space-between; font-size: .73rem; color: var(--text-tertiary); }

/* Quiz question view */
.qa-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 14px; }
.qa-prog-bar { height: 6px; background: var(--bg-3); border-radius: 99px; flex: 1; overflow: hidden; }
.qa-prog-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue-500), var(--violet)); transition: width .5s ease; }
.qa-question { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.qa-question h2 { font-family: 'Sora', sans-serif; font-size: 1.2rem; font-weight: 700; line-height: 1.45; color: var(--text-primary); }
.qa-options { display: flex; flex-direction: column; gap: 10px; }
.qa-option { display: flex; align-items: center; gap: 13px; background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 13px 17px; cursor: pointer; font-size: .88rem; font-weight: 500; transition: all var(--t); }
.qa-option:hover { border-color: var(--blue-400); background: var(--blue-50); color: var(--blue-700); }
.qa-option.correct { border-color: var(--success); background: var(--success-bg); color: #065f46; }
.qa-option.wrong   { border-color: var(--error);   background: var(--error-bg);   color: #7f1d1d; }
.opt-letter { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: .76rem; font-weight: 800; flex-shrink: 0; }
.qa-option.correct .opt-letter { background: var(--success); color: #fff; }
.qa-option.wrong   .opt-letter { background: var(--error);   color: #fff; }
.qa-explanation { background: linear-gradient(135deg, var(--blue-50), #f0e7ff); border: 1px solid var(--blue-100); border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; font-size: .86rem; color: var(--text-secondary); line-height: 1.65; display: none; }

/* ── Flashcards ── */
.deck-card { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 20px; cursor: pointer; transition: all var(--t); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.deck-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #93c5fd; }
.deck-emoji { font-size: 2rem; margin-bottom: 10px; }
.deck-card h4 { font-size: .9rem; font-weight: 700; margin-bottom: 3px; color: var(--text-primary); }
.deck-card p { font-size: .78rem; color: var(--text-secondary); flex: 1; }
.deck-count { background: var(--blue-50); color: var(--blue-600); font-size: .72rem; font-weight: 800; padding: 2px 9px; border-radius: var(--radius-full); display: inline-block; }

/* Flashcard study */
.fc-wrap { max-width: 540px; margin: 0 auto; }
.fc-card { perspective: 1200px; height: 280px; cursor: pointer; margin-bottom: 18px; }
.fc-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4,0,.2,1); }
.fc-card.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius-xl); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.fc-front { background: #fff; border: 1.5px solid var(--border); box-shadow: var(--shadow-md); }
.fc-back  { background: linear-gradient(135deg, var(--blue-600), var(--violet)); color: #fff; transform: rotateY(180deg); }
.fc-face-label { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; opacity: .6; }
.fc-front h2 { font-family: 'Sora', sans-serif; font-size: 1.35rem; font-weight: 800; color: var(--text-primary); }
.fc-back p { font-size: .93rem; line-height: 1.65; }
.fc-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fc-btn { padding: 10px 22px; border-radius: var(--radius-full); font-size: .86rem; font-weight: 700; cursor: pointer; transition: all var(--t); border: none; font-family: inherit; }
.fc-btn-wrong { background: var(--error-bg);   color: var(--error);   } .fc-btn-wrong:hover { background: #fecaca; }
.fc-btn-hard  { background: var(--warning-bg); color: var(--warning); } .fc-btn-hard:hover  { background: #fde68a; }
.fc-btn-easy  { background: var(--success-bg); color: var(--success); } .fc-btn-easy:hover  { background: #a7f3d0; }
.fc-due-banner .card-body { padding: 14px 22px !important; }

/* ── Progress page ── */
.heatmap { display: grid; grid-template-columns: repeat(26,1fr); gap: 3px; margin-top: 14px; }
.hc { aspect-ratio: 1; border-radius: 3px; background: var(--bg-3); transition: transform var(--t); cursor: default; }
.hc:hover { transform: scale(1.4); }
.hc.l1 { background: #c7d2fe; } .hc.l2 { background: #a5b4fc; } .hc.l3 { background: var(--blue-400); } .hc.l4 { background: var(--blue-600); }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 100px; margin-top: 14px; }

/* ── Profile & Admin ── */
.profile-hero { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 26px 30px; display: flex; align-items: center; gap: 22px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.profile-ava-lg { width: 68px; height: 68px; border-radius: var(--radius-lg); background: linear-gradient(135deg,var(--blue-600),var(--violet)); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.tbl-head, .tbl-row { display: grid; grid-template-columns: 2.5fr 1fr 1fr 1fr 1fr; padding: 11px 18px; align-items: center; }
.tbl-head { background: var(--bg-3); border-bottom: 1px solid var(--border); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }
.tbl-row { border-bottom: 1px solid var(--border); font-size: .83rem; transition: background var(--t); }
.tbl-row:last-child { border-bottom: none; } .tbl-row:hover { background: var(--bg-3); }
.tbl-user { display: flex; align-items: center; gap: 9px; }
.tbl-ava { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; color: #fff; }
.filter-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-tab { padding: 6px 15px; border-radius: var(--radius-full); border: 1.5px solid var(--border); font-size: .8rem; font-weight: 600; cursor: pointer; background: #fff; color: var(--text-secondary); transition: all var(--t); }
.filter-tab:hover { border-color: var(--blue-400); color: var(--blue-600); }
.filter-tab.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* ── Responsive additions ── */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .fc-buttons { gap: 7px; }
  .fc-btn { padding: 8px 16px; font-size: .8rem; }
  .profile-hero { flex-direction: column; text-align: center; }
  .chat-shell { grid-template-columns: 1fr; }
  .chat-left { display: none; }
}



/* ============================================================
   RESPONSIVIDADE COMPLETA
   ============================================================ */

.topbar-hamburger{display:none;width:38px;height:38px;border-radius:var(--radius);background:transparent;border:1.5px solid var(--border);align-items:center;justify-content:center;cursor:pointer;font-size:1.1rem;color:var(--text-secondary);transition:all var(--t);flex-shrink:0}
.topbar-hamburger:hover{background:var(--bg-3);color:var(--text-primary)}
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(15,23,42,.5);backdrop-filter:blur(4px);z-index:199}
.sidebar-overlay.active{display:block}
body.sidebar-lock{overflow:hidden}

@media(max-width:1024px){
  .sidebar{transform:translateX(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1);box-shadow:none;z-index:200}
  .sidebar.open{transform:translateX(0);box-shadow:8px 0 32px rgba(15,23,42,.18)}
  .app-main{margin-left:0!important;width:100%}
  .topbar-hamburger{display:flex}
  .topbar-search{display:none}
  .grid-4{grid-template-columns:repeat(2,1fr)!important}
  .grid-3{grid-template-columns:repeat(2,1fr)!important}
  .dash-grid{grid-template-columns:1fr!important}
  .features-grid{grid-template-columns:repeat(2,1fr)!important}
}

@media(max-width:768px){
  .page{padding:14px!important;overflow-x:hidden}
  .page-header{margin-bottom:14px}
  .page-header h2{font-size:1.2rem}
  .topbar{padding:0 14px;height:54px}
  .topbar-title{font-size:.95rem}
  .welcome-card{padding:16px 18px}
  .welcome-card h2{font-size:1.1rem}
  .grid-4{grid-template-columns:1fr 1fr!important;gap:10px!important}
  .stat-card{padding:13px!important}
  .stat-value{font-size:1.4rem!important}
  .mat-grid{grid-template-columns:1fr!important}
  .mat-viewer-modal{height:100vh!important;max-height:100vh!important;border-radius:0!important}
  .mat-viewer-body{padding:14px!important}
  .qa-question{padding:16px!important}
  .qa-question h2{font-size:1rem!important}
  .fc-card{height:230px!important}
  .fc-buttons{gap:6px;flex-wrap:wrap}
  .fc-btn{padding:8px 14px;font-size:.8rem}
  .modal-backdrop{align-items:flex-end!important;padding:0!important}
  .modal{border-radius:18px 18px 0 0!important;max-height:90vh!important;overflow-y:auto!important;width:100%!important;max-width:100%!important;padding:18px!important}
  .heatmap{grid-template-columns:repeat(13,1fr)!important;gap:2px!important}
  .day-cards-grid{grid-template-columns:1fr!important}
  .dicas-grid{grid-template-columns:1fr!important}
  .plan-hero{padding:16px!important}
  .plan-body{padding:14px!important}
  .weekday-grid{grid-template-columns:repeat(4,1fr)!important;gap:6px!important}
  .wizard-options{grid-template-columns:1fr!important}
  .wizard-container{padding:18px 14px 80px!important}
  .profile-hero{flex-direction:column!important;text-align:center!important;padding:18px!important}
  .chat-shell{grid-template-columns:1fr!important}
  .chat-left{display:none!important}
  .msg-group{padding:8px 12px!important}
  .user-bubble{max-width:90%!important}
  .chat-input-zone{padding:8px 12px 12px!important}
  .chat-header-bar{padding:10px 12px!important;flex-wrap:wrap!important;gap:6px!important}
  .mode-pills{flex-wrap:wrap!important;gap:4px!important}
  .hero{padding:44px 16px 28px!important}
  .features-grid{grid-template-columns:1fr!important;padding:0 16px!important}
  .lp-nav-inner{padding:0 14px!important}
  .cx-shell{grid-template-columns:1fr!important}
  .cx-sidebar{position:fixed;left:0;top:0;height:100vh;width:280px;z-index:149;transform:translateX(-100%)}
  .cx-sidebar.open{transform:translateX(0)}
  .cx-modes{display:none!important}
  .mm-node-modal{bottom:0!important;right:0!important;left:0!important;width:100%!important;border-radius:18px 18px 0 0!important;max-height:60vh!important;overflow-y:auto!important}
  .ax-shell{grid-template-columns:1fr!important}
  .ax-left{display:none!important}
  .lp-features-grid{grid-template-columns:1fr!important}
  .lp-pricing-grid{grid-template-columns:1fr!important}
  .lp-steps{flex-direction:column!important;gap:10px!important}
  .lp-step-arrow{transform:rotate(90deg)!important}
}

@media(max-width:480px){
  .grid-4{grid-template-columns:1fr 1fr!important;gap:8px!important}
  .grid-3{grid-template-columns:1fr!important}
  .stat-value{font-size:1.2rem!important}
  .fc-btn{padding:7px 12px!important;font-size:.77rem!important}
  .chat-hints{display:none!important}
  .lp-hero-actions{flex-direction:column!important}
  .lp-stats{flex-direction:column!important;gap:8px!important}
}

@media(min-width:1280px){
  .grid-4{grid-template-columns:repeat(4,1fr)!important}
  .grid-3{grid-template-columns:repeat(3,1fr)!important}
}

@media(min-width:1800px){
  .app-main>.page{max-width:1400px;margin:0 auto}
}

html,body{overflow-x:hidden!important;max-width:100vw}
.page{overflow-x:hidden}
