/* ============================================================
   CFDCD · Design System
   Platformă de Formare și Dezvoltare în Cariera Didactică
   ============================================================ */

:root {
    /* Cerneală & suprafețe */
    --ink: #131730;
    --ink-soft: #475069;
    --muted: #77809a;
    --paper: #eef0f7;
    --card: #ffffff;
    --line: #e4e7f0;

    /* Brand — administrare (indigo/violet) */
    --brand: #4f46e5;
    --brand-deep: #3730a3;
    --brand-ink: #1e1b4b;
    --brand-grad: linear-gradient(120deg, #312e81 0%, #4f46e5 55%, #7c3aed 100%);

    /* Profesor (emerald/teal) */
    --teach: #059669;
    --teach-deep: #065f46;
    --teach-grad: linear-gradient(120deg, #064e3b 0%, #059669 55%, #0d9488 100%);

    /* Semantice */
    --ok: #16a34a;
    --warn: #d97706;
    --bad: #dc2626;
    --info: #0284c7;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(19, 23, 48, .04), 0 8px 24px -12px rgba(19, 23, 48, .18);
    --shadow-lg: 0 24px 60px -24px rgba(30, 27, 75, .35);

    --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ---------- Bază ---------- */
body {
    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(1100px 500px at 85% -10%, rgba(124, 58, 237, .07), transparent 60%),
        radial-gradient(900px 420px at -10% 0%, rgba(79, 70, 229, .08), transparent 55%);
    background-attachment: fixed;
    min-height: 100vh;
}

body.theme-teacher {
    background-image:
        radial-gradient(1100px 500px at 85% -10%, rgba(13, 148, 136, .08), transparent 60%),
        radial-gradient(900px 420px at -10% 0%, rgba(5, 150, 105, .08), transparent 55%);
}

h1, h2, h3, h4, h5, h6, .font-display { font-family: var(--font-display); }

::selection { background: rgba(79, 70, 229, .18); }

/* ---------- Navbar aplicație ---------- */
.app-nav {
    background: var(--brand-grad);
    padding: .85rem 0;
    box-shadow: 0 10px 30px -18px rgba(30, 27, 75, .8);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.theme-teacher .app-nav { background: var(--teach-grad); }

.app-nav .brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    text-decoration: none;
    min-width: 0;
}

.app-nav .brand-logo {
    width: 42px; height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    overflow: hidden;
}
.app-nav .brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background:#fff; }

.app-nav .brand-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .98rem;
    line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-nav .brand-sub {
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .65);
    white-space: nowrap;
}

.avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    border: 1.5px solid rgba(255, 255, 255, .35);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .85rem;
    font-family: var(--font-display);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .75rem .3rem .35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
}
.user-chip .role-tag {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .7);
    display: block;
    line-height: 1;
}
.user-chip .user-name {
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.2;
    max-width: 180px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.btn-nav {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, .35);
    --bs-btn-hover-bg: rgba(255, 255, 255, .95);
    --bs-btn-hover-color: var(--brand-deep);
    --bs-btn-hover-border-color: transparent;
    border-radius: 999px;
    font-weight: 600;
    font-size: .82rem;
}
.theme-teacher .btn-nav { --bs-btn-hover-color: var(--teach-deep); }

/* ---------- Antet pagină ---------- */
.page-head { margin: 1.75rem 0 1.25rem; }
.page-head .eyebrow {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--brand);
}
.theme-teacher .page-head .eyebrow { color: var(--teach); }
.page-head h1 {
    font-size: 1.55rem;
    font-weight: 800;
    margin: .15rem 0 0;
}
.page-head .lead-sub { color: var(--muted); font-size: .92rem; margin: .3rem 0 0; }

/* ---------- Carduri ---------- */
.card-x {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-x .card-x-head {
    padding: 1.15rem 1.35rem .95rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}
.card-x .card-x-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.02rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.card-x .card-x-title .ico {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: 1rem;
    background: rgba(79, 70, 229, .1);
    color: var(--brand);
}
.card-x .card-x-title .ico.ico-green { background: rgba(5, 150, 105, .12); color: var(--teach); }
.card-x .card-x-title .ico.ico-amber { background: rgba(217, 119, 6, .12); color: var(--warn); }
.card-x .card-x-title .ico.ico-red   { background: rgba(220, 38, 38, .1);  color: var(--bad); }
.card-x .card-x-body { padding: 1.25rem 1.35rem; }
.card-x .card-x-body.flush { padding: 0; }

/* ---------- Carduri statistici ---------- */
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.15rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--accent, var(--brand));
    opacity: .9;
}
.stat-card .stat-ico {
    width: 52px; height: 52px;
    flex: 0 0 52px;
    border-radius: 14px;
    display: grid; place-items: center;
    font-size: 1.4rem;
    color: #fff;
    background: var(--accent, var(--brand));
}
.stat-card .stat-num {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
}
.stat-card .stat-lbl {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

/* ---------- Tabele ---------- */
.table-x { margin: 0; }
.table-x thead th {
    background: #f7f8fc;
    color: var(--ink-soft);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    border-bottom: 1px solid var(--line) !important;
    padding: .8rem 1rem;
    white-space: nowrap;
}
.table-x tbody td {
    padding: .85rem 1rem;
    vertical-align: middle;
    border-color: #eef0f6;
    font-size: .9rem;
}
.table-x tbody tr { transition: background .12s ease; }
.table-x tbody tr:hover { background: #f6f7ff; }
.theme-teacher .table-x tbody tr:hover { background: #f3fbf8; }

/* ---------- Badge-uri soft ---------- */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .38em .8em;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .02em;
    border: 1px solid transparent;
}
.badge-soft.b-green  { background: #e7f8ef; color: #15803d; border-color: #bbebd0; }
.badge-soft.b-amber  { background: #fdf3e2; color: #b45309; border-color: #f6dfb3; }
.badge-soft.b-red    { background: #fdeaea; color: #b91c1c; border-color: #f6c6c6; }
.badge-soft.b-indigo { background: #edecfd; color: #4338ca; border-color: #d5d3f8; }
.badge-soft.b-gray   { background: #f1f3f8; color: #5b6478; border-color: #e0e4ee; }
.badge-soft.b-teal   { background: #e3f7f5; color: #0f766e; border-color: #bceae6; }

/* Puls pentru notificări */
@keyframes gentle-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.14); opacity: .85; }
}
.bula-puls { animation: gentle-pulse 1.8s infinite ease-in-out; }

/* ---------- Filtru alfabetic ---------- */
.alpha-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    padding: .65rem;
    background: #f7f8fc;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.alpha-bar a {
    min-width: 32px;
    text-align: center;
    padding: .3rem .45rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: .8rem;
    color: var(--ink-soft);
    text-decoration: none;
    transition: all .12s ease;
}
.alpha-bar a:hover { background: #e9ebf5; color: var(--brand-deep); }
.alpha-bar a.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 10px -3px rgba(79, 70, 229, .5);
}

/* ---------- Butoane ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-brand {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-deep);
    --bs-btn-hover-border-color: var(--brand-deep);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--brand-deep);
    --bs-btn-active-color: #fff;
}
.btn-teach {
    --bs-btn-bg: var(--teach);
    --bs-btn-border-color: var(--teach);
    --bs-btn-hover-bg: var(--teach-deep);
    --bs-btn-hover-border-color: var(--teach-deep);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--teach-deep);
    --bs-btn-active-color: #fff;
}
.btn-icon { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Formulare ---------- */
.form-control, .form-select {
    border-radius: 10px;
    border-color: #dde1ec;
    padding: .55rem .85rem;
    font-size: .92rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .12);
}
.theme-teacher .form-control:focus, .theme-teacher .form-select:focus {
    border-color: var(--teach);
    box-shadow: 0 0 0 .2rem rgba(5, 150, 105, .12);
}
.form-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
}

/* ---------- Alerte ---------- */
.alert { border-radius: var(--radius-sm); border-width: 1px; }

/* ---------- Modale ---------- */
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-header { border-bottom: 1px solid var(--line); }
.modal-header.mh-brand { background: var(--brand-grad); color: #fff; border: none; }
.modal-header.mh-teach { background: var(--teach-grad); color: #fff; border: none; }
.modal-header.mh-dark  { background: linear-gradient(120deg, #1e293b, #334155); color: #fff; border: none; }
.modal-header.mh-amber { background: linear-gradient(120deg, #b45309, #f59e0b); color: #fff; border: none; }
.modal-header.mh-red   { background: linear-gradient(120deg, #991b1b, #dc2626); color: #fff; border: none; }

/* ---------- Paginare ---------- */
.pagination .page-link {
    border-radius: 8px !important;
    margin: 0 .15rem;
    border-color: var(--line);
    color: var(--ink-soft);
    font-weight: 600;
    font-size: .85rem;
}
.pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 4px 10px -3px rgba(79, 70, 229, .5);
}

/* ============================================================
   PAGINI DE AUTENTIFICARE (login / schimbare parolă)
   ============================================================ */
.auth-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--brand-ink);
    position: relative;
    overflow: hidden;
}
.auth-body::before, .auth-body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .55;
    animation: blob-drift 16s ease-in-out infinite alternate;
}
.auth-body::before {
    width: 520px; height: 520px;
    background: #4f46e5;
    top: -160px; left: -120px;
}
.auth-body::after {
    width: 460px; height: 460px;
    background: #7c3aed;
    bottom: -140px; right: -100px;
    animation-delay: -8s;
}
@keyframes blob-drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, 40px) scale(1.15); }
}

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 430px;
    background: rgba(255, 255, 255, .97);
    border-radius: 22px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6);
    overflow: hidden;
}
.auth-card .auth-head {
    text-align: center;
    padding: 2.1rem 1.75rem 1.4rem;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(400px 160px at 50% -60px, rgba(79, 70, 229, .1), transparent);
}
.auth-card .auth-logo {
    width: 84px; height: 84px;
    margin: 0 auto .85rem;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: grid; place-items: center;
    overflow: hidden;
}
.auth-card .auth-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.auth-card .auth-logo i { font-size: 2.4rem; color: var(--brand); }
.auth-card .auth-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.28rem;
    color: var(--brand-ink);
    margin: 0;
}
.auth-card .auth-sub {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 600;
    margin: .25rem 0 0;
}
.auth-card .auth-body-inner { padding: 1.75rem; }

.auth-footer-note {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, .55);
    font-size: .75rem;
    text-align: center;
    margin-top: 1.1rem;
    letter-spacing: .04em;
}

.input-icon-group .input-group-text {
    background: #f7f8fc;
    border-color: #dde1ec;
    border-radius: 10px 0 0 10px;
    color: var(--muted);
}
.input-icon-group .form-control { border-left: 0; border-radius: 0 10px 10px 0; }

/* ---------- Diverse ---------- */
.text-brand { color: var(--brand) !important; }
.text-teach { color: var(--teach) !important; }
.divider-soft { border-top: 1px solid var(--line); margin: 1.25rem 0; }

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 3rem 1rem;
}
.empty-state i { font-size: 2.3rem; display: block; margin-bottom: .6rem; opacity: .5; }

@media (max-width: 576px) {
    .page-head h1 { font-size: 1.25rem; }
    .user-chip .user-name { max-width: 110px; }
    .app-nav .brand-title { font-size: .85rem; }
}
