/* ============================================================
   student.css — Student Panel Layout + All Student Page Styles
   ============================================================ */

/* ── CSS Variables ── */
:root {
    --primary:   #4361EE;
    --secondary: #7209B7;
    --accent:    #F72585;
    --success:   #2EC4B6;
    --warning:   #FF9F1C;
    --bg:        #F0F4FF;
    --card-bg:   #ffffff;
    --text:      #1E2A4A;
    --muted:     #6B7A99;
    --border:    #E2E8F8;
}

* { box-sizing: border-box; }
html, body { margin: 0 !important; padding: 0 !important; }
body { font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
nav.navbar-main { margin-top: 0 !important; }

/* ── Navbar ── */
.navbar-brand img { height: 36px; }
.navbar-main { background: linear-gradient(135deg,var(--primary) 0%,var(--secondary) 100%); box-shadow: 0 4px 20px rgba(67,97,238,.35); padding: .85rem 0; }
.navbar-main .navbar-brand { font-weight: 700; font-size: 1.3rem; color: #fff !important; letter-spacing: -.3px; }
.navbar-main .navbar-brand span { background: linear-gradient(90deg,#fff 30%,#F0F4FF 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.navbar-main .nav-link { color: rgba(255,255,255,.85) !important; font-weight: 500; font-size: .9rem; transition: color .2s; }
.navbar-main .nav-link:hover { color: #fff !important; }
.btn-nav-logout { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff !important; border-radius: 8px; padding: .35rem .9rem; font-size: .85rem; font-weight: 500; transition: background .2s; }
.btn-nav-logout:hover { background: rgba(255,255,255,.25); }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.4); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; color: #fff; flex-shrink: 0; letter-spacing: 0; }
.nav-user-name { font-size: .88rem; font-weight: 500; color: rgba(255,255,255,.9); }

/* ── Main content ── */
main { flex: 1; }

/* ── Alerts ── */
.alert { border: none; border-radius: 12px; font-size: .88rem; font-weight: 500; }
.alert-success { background: #d1f8ef; color: #065f46; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-info    { background: #dbeafe; color: #1e40af; }
.alert-warning { background: #fef3c7; color: #92400e; }

/* ── Footer ── */
.footer { background: var(--text); color: rgba(255,255,255,.6); text-align: center; padding: 1.2rem; font-size: .82rem; }
.footer a { color: rgba(255,255,255,.8); text-decoration: none; }

/* ── Placeholders / Scrollbar ── */
::placeholder { color: #b0bbcc !important; opacity: 1; }
::-ms-input-placeholder { color: #b0bbcc !important; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* ── Auth pages (login, register, verify-otp) ── */
.auth-wrapper { min-height: calc(100vh - 130px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { background: var(--card-bg); border-radius: 20px; box-shadow: 0 10px 40px rgba(67,97,238,.12); width: 100%; max-width: 460px; padding: 2.5rem; }
.auth-card--wide { max-width: 520px; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-icon { width: 64px; height: 64px; background: linear-gradient(135deg,var(--primary),var(--secondary)); border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.6rem; color: #fff; }
.auth-header h2 { font-size: 1.55rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.auth-header p { color: var(--muted); font-size: .88rem; line-height: 1.6; }
.form-label { font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.form-control { border: 1.5px solid var(--border); border-radius: 10px; padding: .65rem 1rem; font-size: .9rem; color: var(--text); background: #fff; transition: border-color .2s, box-shadow .2s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,.12); outline: none; }
.form-select { border: 1.5px solid var(--border); border-radius: 10px; padding: .65rem 1rem; font-size: .9rem; color: var(--text); background: #fff; transition: border-color .2s, box-shadow .2s; }
.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,.12); outline: none; }
.input-group .form-control { border-right: none; border-radius: 10px 0 0 10px; }
.input-group .btn-toggle-pw { border: 1.5px solid var(--border); border-left: none; border-radius: 0 10px 10px 0; background: #fff; color: var(--muted); padding: 0 .9rem; transition: color .2s; }
.input-group .btn-toggle-pw:hover { color: var(--primary); }
.input-group:focus-within .btn-toggle-pw { border-color: var(--primary); }
.input-group .form-select { border-radius: 10px 0 0 10px; border-right: none; max-width: 115px; flex: 0 0 115px; }
.input-group .form-control.phone-input { border-radius: 0 10px 10px 0; }
.input-group:focus-within .form-select, .input-group:focus-within .form-control { border-color: var(--primary); }
.pw-group .form-control { border-right: none; border-radius: 10px 0 0 10px; }
.pw-group .btn-toggle-pw { border: 1.5px solid var(--border); border-left: none; border-radius: 0 10px 10px 0; background: #fff; color: var(--muted); padding: 0 .9rem; transition: color .2s; }
.pw-group .btn-toggle-pw:hover { color: var(--primary); }
.pw-group:focus-within .btn-toggle-pw { border-color: var(--primary); }
.btn-auth { background: linear-gradient(135deg,var(--primary),var(--secondary)); border: none; border-radius: 10px; color: #fff; font-weight: 600; font-size: .95rem; padding: .75rem; width: 100%; transition: opacity .2s, transform .1s; }
.btn-auth:hover { opacity: .9; transform: translateY(-1px); }
.btn-auth:active { transform: translateY(0); }
.divider { text-align: center; position: relative; margin: 1.5rem 0; color: var(--muted); font-size: .8rem; }
.divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--border); }
.divider::before { left: 0; }
.divider::after  { right: 0; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .87rem; color: var(--muted); }
.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.invalid-feedback { font-size: .82rem; }
.strength-bar { height: 4px; border-radius: 4px; background: var(--border); margin-top: .5rem; overflow: hidden; }
.strength-fill { height: 100%; width: 0; border-radius: 4px; transition: width .3s, background .3s; }
.strength-label { font-size: .75rem; color: var(--muted); margin-top: .3rem; }

/* OTP verify */
.email-badge { display: inline-block; background: rgba(67,97,238,.08); color: var(--primary); border-radius: 8px; padding: .2rem .6rem; font-weight: 600; font-size: .85rem; word-break: break-all; }
.otp-group { display: flex; gap: .6rem; justify-content: center; margin: 1.5rem 0; }
.otp-box { width: 52px; height: 58px; border: 2px solid var(--border); border-radius: 12px; text-align: center; font-size: 1.4rem; font-weight: 700; color: var(--text); background: #fff; transition: border-color .2s, box-shadow .2s; caret-color: var(--primary); }
.otp-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,.15); outline: none; }
.otp-box.is-invalid { border-color: #ef4444; }
input[name="otp"] { display: none; }
.resend-section { text-align: center; margin-top: 1.5rem; font-size: .87rem; color: var(--muted); }
.resend-section form { display: inline; }
#countdown { font-weight: 600; color: var(--primary); }
.btn-link-resend { background: none; border: none; color: var(--primary); font-weight: 600; font-size: .87rem; padding: 0; cursor: pointer; text-decoration: none; }
.btn-link-resend:hover { text-decoration: underline; }
.btn-link-resend:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

/* ── Dashboard ── */
.hero-banner { background: linear-gradient(135deg,var(--primary) 0%,var(--secondary) 100%); color: #fff; padding: 2.5rem 0 3.5rem; position: relative; overflow: hidden; }
.hero-banner::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 40px; background: var(--bg); clip-path: ellipse(55% 100% at 50% 100%); }
.hero-banner h1 { font-size: 1.9rem; font-weight: 700; margin-bottom: .4rem; }
.hero-banner p  { opacity: .85; font-size: .95rem; margin: 0; }
.hero-stats { display: flex; gap: 1.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.hero-stat { background: rgba(255,255,255,.15); border-radius: 12px; padding: .65rem 1.1rem; backdrop-filter: blur(4px); font-size: .85rem; }
.hero-stat strong { display: block; font-size: 1.25rem; font-weight: 700; }
.section-heading { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 1.25rem; }
.section-heading .bar { width: 4px; height: 20px; border-radius: 4px; background: linear-gradient(180deg,var(--primary),var(--secondary)); display: inline-block; flex-shrink: 0; }
.section-heading .heading-context { font-size: .9rem; font-weight: 500; color: var(--muted); }
.quick-card { background: var(--card-bg); border-radius: 16px; padding: 1.3rem 1.5rem; box-shadow: 0 2px 14px rgba(67,97,238,.07); border: 1.5px solid var(--border); display: flex; align-items: center; gap: 1rem; transition: transform .2s, box-shadow .2s; text-decoration: none; color: inherit; }
.quick-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(67,97,238,.13); color: inherit; }
.quick-card-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.quick-card h6 { font-size: .9rem; font-weight: 700; color: var(--text); margin: 0 0 .15rem; }
.quick-card p  { font-size: .78rem; color: var(--muted); margin: 0; }
.badge-soon { background: rgba(247,37,133,.1); color: var(--accent); border-radius: 6px; font-size: .72rem; font-weight: 600; padding: .15rem .45rem; margin-left: .4rem; }
.subject-card { background: var(--card-bg); border-radius: 18px; padding: 1.5rem; box-shadow: 0 2px 16px rgba(67,97,238,.07); border: 1.5px solid var(--border); transition: transform .2s, box-shadow .2s; height: 100%; display: flex; flex-direction: column; }
.subject-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(67,97,238,.14); }
.subject-icon { width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 1rem; flex-shrink: 0; }
.subject-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.subject-icon.purple { background: #ede9fe; color: #6d28d9; }
.subject-icon.orange { background: #ffedd5; color: #c2410c; }
.subject-icon.green  { background: #d1fae5; color: #065f46; }
.subject-card h5 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: .3rem; }
.subject-card p  { color: var(--muted); font-size: .82rem; line-height: 1.5; flex: 1; }
.subject-meta { display: flex; gap: 1rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.subject-meta span { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.subject-meta span i { color: var(--primary); font-size: .75rem; }
.btn-study { margin-top: 1rem; background: linear-gradient(135deg,var(--primary),var(--secondary)); border: none; border-radius: 9px; color: #fff; font-size: .85rem; font-weight: 600; padding: .5rem 1.1rem; transition: opacity .2s; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; width: fit-content; }
.btn-study:hover { opacity: .88; color: #fff; }

/* ── Study subject page ── */
.page-hero { background: linear-gradient(135deg,var(--primary) 0%,var(--secondary) 100%); color: #fff; padding: 2rem 0 3rem; position: relative; overflow: hidden; }
.page-hero::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 36px; background: var(--bg); clip-path: ellipse(55% 100% at 50% 100%); }
.breadcrumb-nav { font-size: .82rem; opacity: .8; margin-bottom: .6rem; }
.breadcrumb-nav a { color: rgba(255,255,255,.85); text-decoration: none; }
.breadcrumb-nav a:hover { color: #fff; }
.breadcrumb-nav span { margin: 0 .4rem; }
.topic-block { margin-bottom: .9rem; }
.topic-header { background: var(--card-bg); border-radius: 16px; border: 1.5px solid var(--border); padding: 1.1rem 1.5rem; display: flex; align-items: center; gap: 1rem; cursor: pointer; box-shadow: 0 2px 12px rgba(67,97,238,.05); transition: border-color .25s, box-shadow .25s, border-radius .25s; user-select: none; }
.topic-header:hover { border-color: var(--primary); box-shadow: 0 6px 24px rgba(67,97,238,.13); }
.topic-header.is-open { border-radius: 16px 16px 0 0; border-color: var(--primary); border-bottom-color: transparent; }
.topic-num { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg,var(--primary),var(--secondary)); color: #fff; font-size: .85rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topic-info { flex: 1; min-width: 0; }
.topic-info h6 { font-size: .96rem; font-weight: 700; color: var(--text); margin: 0 0 .1rem; }
.topic-info small { font-size: .76rem; color: var(--muted); }
.topic-chevron { color: var(--muted); font-size: .85rem; transition: transform .3s ease; flex-shrink: 0; }
.topic-header.is-open .topic-chevron { transform: rotate(180deg); }
.topic-body { background: var(--card-bg); border: 1.5px solid var(--primary); border-top: none; border-radius: 0 0 16px 16px; box-shadow: 0 8px 28px rgba(67,97,238,.07); }
.subtopics-col-head { display: flex; align-items: center; padding: .6rem 1.5rem; background: rgba(67,97,238,.04); border-bottom: 1px solid var(--border); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.subtopics-col-head .col-name { flex: 1; min-width: 0; overflow: hidden; }
.subtopics-col-head .col-res  { width: 158px; text-align: right; padding-right: 2px; }
.col-name .ch-label { text-transform: uppercase; letter-spacing: .06em; }
.col-name .ch-of    { font-weight: 400; opacity: .55; margin: 0 .28rem; text-transform: lowercase; letter-spacing: 0; }
.col-name .ch-topic { color: var(--primary); font-weight: 700; text-transform: none; letter-spacing: 0; }
.col-name .ch-pipe  { opacity: .3; margin: 0 .3rem; font-weight: 300; }
.col-name .ch-subj  { font-weight: 500; opacity: .65; text-transform: none; letter-spacing: 0; }
.subtopic-row { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.5rem; border-bottom: 1px solid var(--border); transition: background .15s; }
.subtopic-row:last-child { border-bottom: none; }
.subtopic-row:hover { background: rgba(67,97,238,.025); }
.st-idx { width: 26px; height: 26px; border-radius: 7px; background: rgba(67,97,238,.08); color: var(--primary); font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.st-name { font-size: .88rem; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.resource-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.r-btn { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: .88rem; text-decoration: none; border: none; padding: 0; cursor: pointer; transition: background .18s, color .18s, transform .18s, box-shadow .18s; position: relative; flex-shrink: 0; line-height: 1; }
.r-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(67,97,238,.3); }
.r-btn--pdf   { background: #fee2e2; color: #dc2626; }
.r-btn--pdf:hover  { background: #dc2626; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(220,38,38,.28); }
.r-btn--yt    { background: #fee2e2; color: #cc0000; }
.r-btn--yt:hover   { background: #cc0000; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(204,0,0,.28); }
.r-btn--link  { background: rgba(67,97,238,.1); color: var(--primary); }
.r-btn--link:hover { background: var(--primary); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(67,97,238,.28); }
.r-btn--support { background: rgba(5,150,105,.1); color: #059669; }
.r-btn--support:hover { background: #059669; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(5,150,105,.28); }
.r-btn--off { background: rgba(107,122,153,.07); color: #c4cdd9; cursor: default; }
.r-badge { position: absolute; top: -5px; right: -5px; background: var(--primary); color: #fff; border-radius: 50%; width: 15px; height: 15px; font-size: .58rem; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.resource-actions .dropdown-toggle::after { display: none; }
.resource-actions .dropdown-menu { border-radius: 12px; border: 1.5px solid var(--border); box-shadow: 0 8px 24px rgba(67,97,238,.13); font-size: .82rem; min-width: 195px; padding: .4rem; }
.resource-actions .dropdown-item { border-radius: 8px; padding: .45rem .85rem; color: var(--text); font-weight: 500; transition: background .14s; display: flex; align-items: center; gap: .5rem; }
.resource-actions .dropdown-item:hover { background: rgba(67,97,238,.07); color: var(--text); }
.empty-state { text-align: center; padding: 3rem; color: var(--muted); font-size: .9rem; }
.empty-state-sm { text-align: center; padding: 1.4rem 1.5rem; color: var(--muted); font-size: .84rem; }

/* ── PYP page ── */
.year-group { margin-bottom: 2rem; }
.year-badge { display: inline-flex; align-items: center; gap: .5rem; background: linear-gradient(135deg,var(--primary),var(--secondary)); color: #fff; border-radius: 10px; padding: .4rem 1rem; font-size: .95rem; font-weight: 700; margin-bottom: 1rem; }
.pyp-card { background: var(--card-bg); border-radius: 14px; border: 1.5px solid var(--border); padding: 1.1rem 1.4rem; box-shadow: 0 2px 10px rgba(67,97,238,.06); display: flex; align-items: center; gap: 1rem; transition: transform .2s, box-shadow .2s, border-color .2s; }
.pyp-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(67,97,238,.12); border-color: var(--primary); }
.pdf-icon { width: 44px; height: 44px; border-radius: 11px; background: #fee2e2; color: #dc2626; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.pyp-card h6 { font-size: .9rem; font-weight: 700; color: var(--text); margin: 0; }
.btn-view-pdf { margin-left: auto; background: linear-gradient(135deg,var(--primary),var(--secondary)); border: none; border-radius: 9px; color: #fff; font-size: .82rem; font-weight: 600; padding: .42rem .95rem; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; flex-shrink: 0; transition: opacity .2s; }
.btn-view-pdf:hover { opacity: .88; color: #fff; }

/* ── Support pages (index, show, create) ── */
.support-hero { background: linear-gradient(135deg,var(--primary) 0%,var(--secondary) 100%); color: #fff; padding: 2rem 0 3rem; position: relative; overflow: hidden; }
.support-hero::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 36px; background: var(--bg); clip-path: ellipse(55% 100% at 50% 100%); }
.ticket-card { background: #fff; border-radius: 14px; border: 1.5px solid var(--border); padding: 1.2rem 1.4rem; margin-bottom: .7rem; box-shadow: 0 2px 12px rgba(67,97,238,.05); transition: box-shadow .2s; text-decoration: none; display: block; color: inherit; }
.ticket-card:hover { box-shadow: 0 6px 24px rgba(67,97,238,.11); border-color: var(--primary); }
.tc-title { font-size: .92rem; font-weight: 700; color: var(--text); }
.tc-meta { font-size: .78rem; color: var(--muted); margin-top: .3rem; display: flex; flex-wrap: wrap; gap: .4rem .8rem; }
.tc-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.badge-mode-am  { background: #dbeafe; color: #1d4ed8; font-size: .7rem; font-weight: 700; padding: .15rem .55rem; border-radius: 20px; }
.badge-mode-lds { background: #fce7f3; color: #be185d; font-size: .7rem; font-weight: 700; padding: .15rem .55rem; border-radius: 20px; }
.resolved-badge { background: #d1fae5; color: #065f46; font-size: .7rem; font-weight: 700; padding: .15rem .55rem; border-radius: 20px; display: inline-flex; align-items: center; gap: .3rem; }
.detail-card { background: #fff; border-radius: 14px; border: 1.5px solid var(--border); padding: 1.4rem 1.6rem; box-shadow: 0 2px 12px rgba(67,97,238,.05); margin-bottom: 1rem; }
.detail-card h5 { font-size: .92rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; padding-bottom: .6rem; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.meta-row { display: flex; gap: .7rem; margin-bottom: .6rem; font-size: .84rem; }
.meta-label { font-weight: 700; color: var(--muted); min-width: 110px; flex-shrink: 0; }
.question-box { background: var(--bg); border-radius: 10px; padding: 1rem 1.2rem; font-size: .88rem; color: var(--text); line-height: 1.7; white-space: pre-wrap; }
.response-box { background: #d1fae5; border: 1.5px solid #a7f3d0; border-radius: 12px; padding: 1.2rem 1.4rem; }
.response-box .resp-header { font-size: .82rem; font-weight: 700; color: #065f46; margin-bottom: .7rem; display: flex; align-items: center; gap: .5rem; }
.response-box .resp-text { font-size: .88rem; color: #0f172a; line-height: 1.7; white-space: pre-wrap; }
.response-box .resp-meta { font-size: .76rem; color: #6b8a7a; margin-top: .6rem; }
.pending-box { background: #fef3c7; border: 1.5px solid #fde68a; border-radius: 12px; padding: 1.2rem 1.4rem; }
.pending-box .p-title { font-size: .88rem; font-weight: 700; color: #92400e; margin-bottom: .3rem; }
.pending-box p { font-size: .84rem; color: #78350f; margin: 0; line-height: 1.6; }
.session-box { background: #dbeafe; border: 1.5px solid #bfdbfe; border-radius: 12px; padding: 1.2rem 1.4rem; }
.session-box .s-title { font-size: .9rem; font-weight: 700; color: #1d4ed8; margin-bottom: .6rem; }
.session-meta { font-size: .84rem; color: #1e3a8a; }
.attach-link { display: inline-flex; align-items: center; gap: .4rem; background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; padding: .35rem .8rem; font-size: .82rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.attach-link:hover { background: rgba(67,97,238,.08); }
.support-card { background: #fff; border-radius: 16px; border: 1.5px solid var(--border); padding: 2rem; box-shadow: 0 2px 16px rgba(67,97,238,.07); }
.support-card h5 { font-size: .96rem; font-weight: 700; color: var(--text); margin-bottom: 1.2rem; padding-bottom: .7rem; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.mode-option { border: 1.5px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem; cursor: pointer; transition: border-color .18s, background .18s; margin-bottom: .7rem; display: flex; align-items: flex-start; gap: .85rem; }
.mode-option:hover { border-color: var(--primary); }
.mode-option.selected { border-color: var(--primary); background: rgba(67,97,238,.04); }
.mode-option input[type=radio] { margin-top: .15rem; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.mode-option .mo-icon { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.mode-option .mo-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.mode-option .mo-desc { font-size: .8rem; color: var(--muted); margin-top: .15rem; line-height: 1.5; }
.meta-chip { display: inline-flex; align-items: center; gap: .35rem; background: rgba(67,97,238,.08); color: var(--primary); font-size: .78rem; font-weight: 600; padding: .22rem .65rem; border-radius: 20px; }
.btn-submit { background: linear-gradient(135deg,var(--primary),var(--secondary)); border: none; border-radius: 10px; color: #fff; font-size: .9rem; font-weight: 700; padding: .68rem 2rem; cursor: pointer; font-family: 'Poppins', sans-serif; transition: opacity .2s, transform .15s; }
.btn-submit:hover { opacity: .92; transform: translateY(-1px); }

/* ── Profile ── */
.profile-card { background: var(--card-bg); border-radius: 16px; border: 1.5px solid var(--border); padding: 1.8rem; box-shadow: 0 2px 12px rgba(67,97,238,.06); }
.profile-card h5 { font-size: .96rem; font-weight: 700; color: var(--text); margin-bottom: 1.2rem; padding-bottom: .7rem; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg,var(--primary),var(--secondary)); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.pass-strength { height: 4px; border-radius: 4px; margin-top: .4rem; transition: width .3s, background .3s; width: 0; }
.btn-save { background: linear-gradient(135deg,var(--primary),var(--secondary)); border: none; border-radius: 10px; color: #fff; font-size: .88rem; font-weight: 700; padding: .65rem 1.6rem; cursor: pointer; font-family: 'Poppins', sans-serif; transition: opacity .2s; display: inline-flex; align-items: center; }
.btn-save:hover { opacity: .88; }

/* ── Markdown + KaTeX rendering ── */
.md-render { white-space: normal; }
.md-render p { margin: 0 0 .6rem; }
.md-render p:last-child { margin-bottom: 0; }
.md-render ul, .md-render ol { padding-left: 1.4rem; margin: 0 0 .6rem; }
.md-render li { margin-bottom: .2rem; }
.md-render code { background: rgba(67,97,238,.08); padding: .1rem .35rem; border-radius: 4px; font-size: .85em; font-family: 'Courier New', monospace; }
.md-render pre { background: rgba(0,0,0,.04); border-radius: 8px; padding: .75rem 1rem; overflow-x: auto; margin: 0 0 .6rem; }
.md-render pre code { background: none; padding: 0; }
.md-render blockquote { border-left: 3px solid var(--primary); margin: 0 0 .6rem; padding: .3rem .8rem; opacity: .8; }
.md-render .katex-display { overflow-x: auto; overflow-y: hidden; padding: .2rem 0; }

/* ── EasyMDE overrides ── */
.EasyMDEContainer .editor-toolbar { border-radius: 10px 10px 0 0; border-color: var(--border) !important; background: #f8f9fc; }
.EasyMDEContainer .editor-toolbar button { color: var(--text) !important; }
.EasyMDEContainer .editor-toolbar button:hover, .EasyMDEContainer .editor-toolbar button.active { background: rgba(67,97,238,.09) !important; color: var(--primary) !important; }
.EasyMDEContainer .CodeMirror { border-radius: 0 0 10px 10px; border-color: var(--border) !important; font-family: 'Poppins', sans-serif; font-size: .9rem; min-height: 130px; color: var(--text); background: #fff; }
.EasyMDEContainer .CodeMirror:hover { border-color: var(--primary) !important; }
.EasyMDEContainer .CodeMirror-focused { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(67,97,238,.1) !important; }
.EasyMDEContainer .editor-preview { border-radius: 0 0 10px 10px; background: #fff; font-size: .9rem; }
.mde-invalid .EasyMDEContainer .CodeMirror { border-color: #dc2626 !important; }
.math-hint { font-size: .75rem; color: var(--muted); margin-top: .35rem; line-height: 1.5; }
.math-hint code { background: rgba(67,97,238,.08); padding: .05rem .3rem; border-radius: 3px; font-size: .88em; font-family: monospace; color: var(--primary); }

.nav-profile-btn { display: flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); color: #fff !important; padding: .3rem .75rem .3rem .4rem; border-radius: 50px; cursor: pointer; font-family: 'Poppins', sans-serif; transition: background .2s; }
.nav-profile-btn:hover, .nav-profile-btn:focus { background: rgba(255,255,255,.25); outline: none; box-shadow: none; }
.nav-profile-btn::after { border-top-color: rgba(255,255,255,.8); }
.nav-profile-btn + .dropdown-menu { border-radius: 14px; border: 1.5px solid var(--border); box-shadow: 0 8px 28px rgba(67,97,238,.14); min-width: 175px; padding: .4rem; margin-top: .4rem !important; }
.nav-profile-btn + .dropdown-menu .dropdown-item { border-radius: 9px; padding: .55rem .9rem; font-size: .87rem; font-weight: 500; color: var(--text); transition: background .15s; display: flex; align-items: center; }
.nav-profile-btn + .dropdown-menu .dropdown-item:hover { background: rgba(67,97,238,.07); color: var(--text); }
.nav-profile-btn + .dropdown-menu .dropdown-item.text-danger:hover { background: #fee2e2; color: #dc2626 !important; }
