/* =========================================================
   Pregătire Școlară — sistem vizual "carnet de elev"
   Paletă: hârtie albăstruie de caiet, cerneală bleumarin,
   accent auriu (steluțe/calificative), roșu de margine de caiet.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --ink: #4f1326;
    --ink-soft: #6d1b34;
    --paper: #f5f3f0;
    --paper-card: #FFFFFF;
    --gold: #b08d57;
    --green: #3E7D5B;
    --red-margin: #6d1b34;
    --text: #2b2b2b;
    --text-muted: #8a8681;
    --border: #d8d4ce;

    --burgundy: #6d1b34;
    --burgundy-dark: #4f1326;
    --burgundy-light: #8a2846;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --radius: 10px;
    --shadow: 0 2px 10px rgba(79, 19, 38, 0.08), 0 1px 2px rgba(79, 19, 38, 0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px);
    background-size: 100% 32px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
}

a { color: var(--ink); }
a:focus, button:focus, input:focus, textarea:focus, select:focus {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 600;
    margin: 0 0 0.4em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Top bar ---------- */
.topbar {
    background: var(--ink);
    color: #EDE9DF;
    padding: 16px 0;
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.topbar .brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.topbar .brand .dot { color: var(--gold); }
.topbar nav a, .topbar nav span {
    color: #D9DEEA;
    text-decoration: none;
    font-size: 0.92rem;
    margin-left: 18px;
}
.topbar nav a:hover { color: #fff; }
.topbar .role-badge {
    background: rgba(217,164,65,0.18);
    color: var(--gold);
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------- Notebook card: signature element ----------
   Card cu liniatura roșie de margine, ca un caiet de școală. */
.card {
    position: relative;
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 28px 28px 40px;
    margin: 28px 0;
}
.card::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 14px;
    bottom: 14px;
    width: 2px;
    background: var(--red-margin);
    opacity: 0.55;
    border-radius: 2px;
}
.card::after {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 22px;
    background-image: radial-gradient(circle, var(--border) 1.6px, transparent 1.6px);
    background-size: 22px 28px;
    background-position: center;
    opacity: 0.7;
}

.page-header {
    padding: 44px 0 8px;
}
.page-header .eyebrow {
    font-family: var(--font-mono);
    color: var(--red-margin);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    display: block;
}

/* ---------- Forms ---------- */
label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin: 16px 0 6px;
}
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-family: var(--font-body);
    font-size: 0.98rem;
    background: #fff;
    color: var(--text);
}
textarea { resize: vertical; min-height: 120px; }
.field-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

.btn {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 7px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    margin-top: 18px;
}
.btn:hover { background: var(--ink-soft); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #c8933a; }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--paper); }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Alerts / flash ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 0.92rem;
    border: 1px solid transparent;
}
.alert-error { background: #FBEBE8; color: var(--red-margin); border-color: #EFC9C1; }
.alert-success { background: #E8F3ED; color: var(--green); border-color: #C7E4D5; }

/* ---------- Lists ---------- */
.list-item {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.list-item:last-child { border-bottom: none; }
.list-item .meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.list-item h3 { margin: 4px 0 6px; }
.list-item .excerpt { color: var(--text-muted); font-size: 0.92rem; margin: 0; }
.list-item a.stretch { text-decoration: none; color: inherit; display: block; }
.list-item a.stretch:hover h3 { color: var(--red-margin); }

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-state .glyph {
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--gold);
    display: block;
    margin-bottom: 10px;
}

/* ---------- Login page ---------- */
.login-wrap {
    max-width: 420px;
    margin: 60px auto;
    padding: 0 20px;
}
.login-wrap .card { padding: 34px 34px 34px 44px; }
.login-wrap h1 { text-align: left; font-size: 1.6rem; }

.badge-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 100px;
    background: var(--paper);
    color: var(--ink-soft);
    border: 1px solid var(--border);
}

/* ---------- Status abonament ---------- */
.status-box {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    margin: 16px 0;
    border: 1px solid transparent;
}
.status-box.ok { background: #E8F3ED; color: var(--green); border-color: #C7E4D5; }
.status-box.bad { background: #FBEBE8; color: var(--red-margin); border-color: #EFC9C1; }
.status-box.warn { background: #FBF3E3; color: #8A6416; border-color: #EFDCAF; }

/* ---------- Fișă criterii (de încercuit) ---------- */
.criteria-list { margin: 18px 0; }
.criterion {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.criterion:first-child { padding-top: 0; }
.criterion .criterion-label {
    font-weight: 600;
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin-bottom: 10px;
}
.criterion-options { display: flex; gap: 10px; flex-wrap: wrap; }
.criterion-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 100px;
    padding: 8px 18px;
    cursor: pointer;
    background: #fff;
}
.criterion-options input[type=radio] {
    accent-color: var(--red-margin);
    width: 16px; height: 16px;
}
.criterion-options label:has(input:checked) {
    border-color: var(--red-margin);
    background: #FBEBE8;
    color: var(--red-margin);
}

table.simple-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
table.simple-table th, table.simple-table td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
table.simple-table th {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.pill { display: inline-block; padding: 2px 10px; border-radius: 100px; font-size: 0.78rem; font-weight: 600; }
.pill-green { background: #E8F3ED; color: var(--green); }
.pill-red { background: #FBEBE8; color: var(--red-margin); }
.checkbox-grid { display: flex; flex-direction: column; gap: 8px; }
.checkbox-grid label { display: flex; align-items: center; gap: 8px; font-weight: 500; border: none; padding: 4px 0; }

/* ---------- Componente formular/raport (portate din fișa detaliată pe materii) ---------- */
.ps-report-form fieldset { border: none; margin: 10px 0; padding: 0; }
.ps-report-form legend { font-weight: 600; margin-bottom: 4px; }

.ps-section { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin: 14px 0; background: var(--paper-card); }
.ps-section legend { font-weight: 700; padding: 0 8px; font-size: 13px; color: var(--burgundy); text-transform: uppercase; letter-spacing: 0.03em; }

.ps-checkbox-row { display: flex; flex-wrap: wrap; gap: 14px; }
.ps-checkbox-item { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

.ps-dropdown-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }
.ps-dropdown-item { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; min-width: 180px; color: var(--text-muted); }
.ps-dropdown-item select { padding: 6px 8px; font-weight: normal; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.ps-dropdown-full { display: block; margin-top: 10px; max-width: 420px; }

.ps-pill-label { font-weight: 600; font-size: 13px; margin: 8px 0 4px; color: var(--text-muted); }
.ps-choice-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.ps-choice-btn { position: relative; }
.ps-choice-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ps-choice-btn span {
    display: inline-block; padding: 8px 12px; border: 1px solid var(--border); border-radius: 20px;
    font-size: 13px; cursor: pointer; background: #fff; user-select: none; transition: all .15s ease;
}
.ps-choice-btn input:checked + span { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
.ps-choice-btn input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 1px; }

.ps-star-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; flex-wrap: wrap; }
.ps-star-field { display: inline-flex; align-items: center; gap: 8px; }
.ps-star-field-lg { display: block; margin: 10px 0; }
.ps-star-label { font-size: 13px; min-width: 220px; color: var(--text-muted); }
.ps-star-field-lg .ps-star-label { display: block; font-weight: 600; margin-bottom: 4px; }
.ps-stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.ps-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ps-stars label { font-size: 22px; color: var(--border); cursor: pointer; padding: 0 1px; }
.ps-stars input:checked ~ label,
.ps-stars label:hover,
.ps-stars label:hover ~ label { color: var(--gold); }

.ps-quick-note { flex: 1; min-width: 160px; padding: 4px 8px; font-size: 12px; border: 1px solid var(--border); border-radius: 4px; }
.ps-quick-note-select { flex: 1; min-width: 220px; padding: 5px 8px; font-size: 12px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }

.ps-late-minutes, .ps-test-score { display: block; margin-top: 8px; font-size: 13px; }
.ps-notes-field { display: block; margin-top: 14px; font-weight: 600; color: var(--text-muted); }
.ps-notes-field textarea { width: 100%; margin-top: 4px; font-weight: normal; }

.ps-text-group { display: flex; flex-wrap: wrap; gap: 12px; }
.ps-text-group-item { flex: 1; min-width: 200px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.ps-text-group-item textarea { width: 100%; margin-top: 4px; font-weight: normal; }

.ps-session-badge { display: inline-block; font-size: 11px; background: var(--burgundy); color: #fff; border-radius: 10px; padding: 2px 9px; margin-left: 6px; vertical-align: middle; font-weight: 600; }
.ps-session-badge-lg { font-size: 13px; padding: 6px 14px; }
.ps-report-row { font-size: 13px; margin-bottom: 8px; }
.ps-report-notes { font-size: 13px; margin-top: 10px; }

.ps-auto-summary { background: var(--paper); border: 1px solid var(--border); border-left: 3px solid var(--burgundy); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; }
.ps-auto-summary-title { font-weight: 700; font-size: 12px; margin-bottom: 6px; color: var(--burgundy-dark); text-transform: uppercase; letter-spacing: 0.04em; }
.ps-auto-summary-line { font-size: 13px; margin-bottom: 4px; color: var(--text); }

/* ---------- Antet cu brand (logo + nume centru) ---------- */
.ps-brand-header { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin: 20px 0; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--burgundy); border-radius: 8px; }
.ps-brand-header img { height: 44px; width: auto; border-radius: 4px; }
.ps-brand-header-text { display: flex; flex-direction: column; }
.ps-brand-title { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.04em; font-size: 16px; color: var(--burgundy-dark); text-transform: uppercase; }
.ps-brand-subtitle { font-size: 11px; letter-spacing: 0.14em; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }

footer.site-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 40px 0 60px;
}

@media (max-width: 600px) {
    .card { padding: 22px 18px 22px 30px; }
    .card::after { display: none; }
    h1 { font-size: 1.6rem; }
    .topbar nav a, .topbar nav span { margin-left: 12px; font-size: 0.85rem; }
}

/* --- v4: dashboard stats --- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-box {
    background: var(--paper, #fff);
    border: 1px solid #e4ddd0;
    border-left: 3px solid var(--red-margin);
    border-radius: 6px;
    padding: 14px 16px;
    text-align: left;
}
.stat-num { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 700; color: var(--red-margin); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
