:root {
    --navy: #0f2f5f;
    --navy-2: #123f7d;
    --blue: #2563eb;
    --blue-soft: #eaf1ff;
    --green: #16a34a;
    --green-soft: #ecfdf3;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --orange: #f59e0b;
    --orange-soft: #fffbeb;
    --purple: #7c3aed;
    --purple-soft: #f3e8ff;
    --bg: #f3f6fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #667085;
    --border: #dfe7f2;
    --border-soft: #edf2f7;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
    --radius: 18px;
    --radius-sm: 12px;
}

/* RESET */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    color: var(--muted);
    line-height: 1.65;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* BUTTONS */
button,
.btn,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    background: linear-gradient(135deg, var(--blue), #1d4ed8);
    color: #ffffff !important;
    border: 0;
    padding: 11px 18px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.20);
    transition: 0.18s ease;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.btn.secondary {
    background: #475467;
    box-shadow: 0 8px 18px rgba(71, 84, 103, 0.16);
}

.btn.gray {
    background: #475467;
}

.btn.red,
.small-btn.danger {
    background: var(--red);
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.18);
}

.small-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue);
    color: white !important;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    margin: 2px;
    transition: 0.18s ease;
}

.small-btn:hover {
    transform: translateY(-1px);
    filter: brightness(0.96);
}

/* FORMS */
label {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
    font-size: 13px;
    color: #243044;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 12px 13px;
    border: 1px solid #cfd8e6;
    border-radius: 12px;
    font-size: 15px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition: 0.18s ease;
}

textarea {
    min-height: 115px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

/* LOGIN */
.login-page,
.public-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
    background:
        radial-gradient(circle at top left, rgba(47, 128, 237, 0.24), transparent 34%),
        linear-gradient(135deg, #0d2a55, #123f7d 55%, #0b2346);
}

.login-card,
.install-box {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    padding: 36px;
    border-radius: 24px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.23);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.login-card h1,
.install-box h1 {
    margin: 0 0 8px;
    font-size: 32px;
    letter-spacing: -0.04em;
    color: #0f172a;
}

.login-card p,
.install-box p {
    margin-bottom: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--navy);
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.logo:before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--blue), var(--navy));
    display: inline-block;
}

/* APP LAYOUT */
.app {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}

.sidebar {
    width: 282px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), transparent 28%),
        linear-gradient(180deg, var(--navy-2), var(--navy));
    color: #ffffff;
    padding: 30px 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 12px 0 34px rgba(15, 47, 95, 0.20);
}

.brand {
    font-size: 28px;
    font-weight: 950;
    line-height: 1.08;
    margin-bottom: 34px;
    letter-spacing: -0.04em;

}

.brand span {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.74);
    letter-spacing: 0;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.88);
    padding: 13px 14px;
    border-radius: 14px;
    margin-bottom: 7px;
    font-weight: 800;
    transition: 0.18s ease;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.14);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar nav a[href*="logout"],
.sidebar nav a[href*="Ieșire"] {
    margin-top: 14px;
}

/* MAIN */
.main {
    flex: 1;
    padding: 34px;
    max-width: calc(100vw - 282px);
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.top h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.15;
    color: #0f172a;
    letter-spacing: -0.05em;
}

.user {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 11px 16px;
    border-radius: 999px;
    font-weight: 850;
    color: var(--navy);
    box-shadow: var(--shadow-soft);
    white-space: nowrap;
}

/* CARDS */
.card {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

.card h2 {
    margin: 0 0 18px;
    font-size: 22px;
    letter-spacing: -0.03em;
    color: #101828;
}

.card h3 {
    color: #101828;
    margin-top: 0;
}

/* STATS */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 60%),
        #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.stat-card:after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    right: -32px;
    bottom: -32px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 999px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 38px;
    line-height: 1;
    color: var(--navy);
    letter-spacing: -0.05em;
}

/* FORMS GRID */
.grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.grid-form .full {
    grid-column: 1 / -1;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form select {
    max-width: 560px;
}

/* TABLES */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
}

th,
td {
    border-bottom: 1px solid var(--border-soft);
    padding: 15px 14px;
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: #344054;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    font-weight: 950;
}

td {
    color: #243044;
}

tr:last-child td {
    border-bottom: 0;
}

tr:hover td {
    background: #fbfdff;
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-soft);
    color: #1d4ed8;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.badge:empty {
    display: none;
}

.ok,
.badge-ok {
    background: var(--green-soft);
    color: #067647;
}

.bad,
.badge-bad {
    background: var(--red-soft);
    color: #b42318;
}

.warn,
.badge-warn {
    background: var(--orange-soft);
    color: #b54708;
}

/* ALERTS */
.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin: 16px 0;
    font-weight: 700;
    background: var(--green-soft);
    border: 1px solid #bbf7d0;
    color: #067647;
}

.alert.error {
    background: var(--red-soft);
    border-color: #fecaca;
    color: #b42318;
}

/* COURSE / TEST */
.course-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0 22px;
}

.pill {
    display: inline-flex;
    align-items: center;
    background: var(--blue-soft);
    color: #1d4ed8;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.question-box {
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 18px;
}

.question-box h3 {
    margin: 0 0 14px;
    color: #0f172a;
    line-height: 1.45;
}

.answer {
    display: block;
    background: #ffffff;
    border: 1px solid #d7deea;
    padding: 13px 15px;
    border-radius: 14px;
    margin: 9px 0;
    font-weight: 700;
    cursor: pointer;
    transition: 0.16s ease;
}

.answer:hover {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.answer input {
    width: auto;
    min-height: auto;
    margin-right: 9px;
}

.result-card {
    border-left: 7px solid var(--blue);
}

/* CHECKS */
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.check input {
    width: auto;
    min-height: auto;
}

/* CERTIFICATE */
.certificate-actions {
    margin-bottom: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.certificate {
    background: white;
    max-width: 900px;
    margin: 0 auto;
    padding: 64px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    line-height: 1.75;
    font-size: 17px;
}

.certificate h1 {
    text-align: center;
    margin: 0 0 8px;
    font-size: 36px;
    letter-spacing: 0.10em;
    color: #0f172a;
}

.certificate h2 {
    text-align: center;
    margin: 0 0 24px;
    font-size: 22px;
    color: var(--navy);
}

.doc-number {
    text-align: center;
    color: var(--muted);
    margin-bottom: 36px;
}

.signatures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 70px;
    text-align: center;
    font-size: 14px;
}

/* CANDIDATE PUBLIC PAGE */
.candidate-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 34%),
        #f4f7fb;
    padding: 42px 20px;
}

.candidate-box {
    max-width: 980px;
    margin: 0 auto;
    background: #ffffff;
    padding: 38px;
    border-radius: 26px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.12);
    border: 1px solid var(--border-soft);
}

.candidate-box h1 {
    margin: 0 0 12px;
    font-size: 34px;
    letter-spacing: -0.05em;
    color: #0f172a;
}

.candidate-box p {
    color: var(--muted);
    line-height: 1.75;
}

.form-section {
    margin: 30px 0;
    padding: 26px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 20px;
}

.form-section h2 {
    margin: 0 0 16px;
    color: var(--navy);
    letter-spacing: -0.03em;
}

.checks label {
    display: block;
    background: white;
    border: 1px solid #d7deea;
    padding: 13px 15px;
    border-radius: 14px;
    margin: 9px 0;
    font-weight: 700;
    cursor: pointer;
}

.checks input {
    width: auto;
    min-height: auto;
    margin-right: 9px;
}

.candidate-result {
    background: var(--green-soft);
    border: 1px solid #bbf7d0;
    color: #067647;
    padding: 20px;
    border-radius: 16px;
    margin: 24px 0;
    font-size: 18px;
}

/* EMPTY / NICE DETAILS */
.card > p:first-of-type {
    margin-top: -6px;
}

table + p {
    margin-top: 16px;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 980px) {
    .app {
        display: block;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 22px;
    }

    .brand {
        margin-bottom: 18px;
    }

    .brand:before {
        display: none;
    }

    .sidebar nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sidebar nav a {
        margin: 0;
    }

    .main {
        max-width: none;
        padding: 24px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-form {
        grid-template-columns: 1fr;
    }

    .top {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .main {
        padding: 18px;
    }

    .top h1 {
        font-size: 28px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .card,
    .candidate-box,
    .form-section {
        padding: 18px;
        border-radius: 16px;
    }

    .login-card,
    .install-box {
        padding: 26px;
        border-radius: 20px;
    }

    th,
    td {
        padding: 11px 10px;
        font-size: 13px;
    }

    .certificate {
        padding: 28px;
    }

    .signatures {
        grid-template-columns: 1fr;
    }
}

/* PRINT */
@media print {
    body {
        background: white;
    }

    .sidebar,
    .top,
    .certificate-actions {
        display: none !important;
    }

    .app {
        display: block;
    }

    .main {
        padding: 0;
        max-width: none;
    }

    .certificate {
        box-shadow: none;
        border: none;
        max-width: none;
        padding: 30px;
    }
.badge-success {
    background: #ecfdf3 !important;
    color: #067647 !important;
}

.badge-warning {
    background: #fffaeb !important;
    color: #b54708 !important;
}

.badge-danger {
    background: #fef3f2 !important;
    color: #b42318 !important;
}

.badge-neutral {
    background: #eef4ff !important;
    color: #1d4ed8 !important;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

@media (max-width: 980px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}