@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@500;600;700&display=swap");

:root {
    color-scheme: light;
    --ns-primary: #063971;
    --ns-secondary: #474a51;
    --ns-accent: #ffcb05;
    --ns-table: #0f172a;
    --ns-surface: #f4f6fb;
    --ns-surface-alt: #ffffff;
    --ns-border: rgba(6, 57, 113, 0.12);
    --ns-muted: rgba(71, 74, 81, 0.72);
    --ns-radius: 14px;
    --ns-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --ns-transition: all 0.22s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ns-secondary);
    background: linear-gradient(180deg, #f7f9ff 0%, #f1f3f9 100%);
    min-height: 100%;
}

a {
    color: var(--ns-primary);
    text-decoration: none;
    transition: var(--ns-transition);
}

a:hover,
a:focus {
    color: var(--ns-accent);
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: "Montserrat", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ns-primary);
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 2.6vw, 2.6rem);
    font-weight: 600;
}

h2 {
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 600;
}

p {
    line-height: 1.7;
    color: var(--ns-secondary);
}

.page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header.top-bar {
    background: var(--ns-primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 12px 30px rgba(6, 57, 113, 0.35);
}

.top-bar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1rem 2.25rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #fff;
    font-size: 1.125rem;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: var(--ns-accent);
}

.nav-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    color: #f8fbff;
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
}

.nav-links a:hover,
.nav-links a:focus {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.main-wrapper {
    flex: 1;
    width: 100%;
    padding: 2.5rem 1.5rem 3rem;
}

.container {
    width: min(1240px, 100%);
    margin: 0 auto;
}

.card,
.panel,
.sheet {
    background: var(--ns-surface-alt);
    border-radius: var(--ns-radius);
    box-shadow: var(--ns-shadow);
    padding: clamp(1.5rem, 2vw, 2rem);
    border: 1px solid var(--ns-border);
}

.card + .card {
    margin-top: 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.button,
button,
input[type="submit"],
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: var(--ns-accent);
    color: #111827;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ns-transition);
}

.button:hover,
button:hover,
.btn:hover,
input[type="submit"]:hover,
.button:focus,
button:focus,
.btn:focus,
input[type="submit"]:focus {
    color: var(--ns-primary);
    box-shadow: 0 16px 40px rgba(255, 203, 5, 0.35);
    transform: translateY(-1px);
}

.button-secondary {
    background: rgba(6, 57, 113, 0.12);
    color: var(--ns-primary);
}

.button-outline {
    background: transparent;
    border: 1px solid var(--ns-primary);
    color: var(--ns-primary);
}

.badge,
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    background: rgba(6, 57, 113, 0.08);
    color: var(--ns-primary);
    margin-right: 0.35rem;
}

.badge-success {
    background: rgba(5, 122, 85, 0.16);
    color: #065f46;
}

.badge-warning {
    background: rgba(255, 203, 5, 0.18);
    color: #92400e;
}

.badge-info {
    background: rgba(6, 57, 113, 0.16);
    color: var(--ns-primary);
}

.alert {
    border-radius: var(--ns-radius);
    padding: 1rem 1.2rem;
    margin: 1rem auto;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.32);
}

.alert-warning {
    background: rgba(253, 186, 116, 0.12);
    color: #9a3412;
    border-color: rgba(253, 186, 116, 0.35);
}

.alert-error {
    background: rgba(248, 113, 113, 0.12);
    color: #991b1b;
    border-color: rgba(248, 113, 113, 0.35);
}

.alert-info {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.3);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--ns-surface-alt);
    border-radius: var(--ns-radius);
    overflow: hidden;
    box-shadow: var(--ns-shadow);
}

thead {
    background: var(--ns-table);
    color: #f8fafc;
}

th,
td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

tbody tr:hover {
    background: rgba(6, 57, 113, 0.04);
}

.error-row {
    background: rgba(248, 113, 113, 0.08);
}

.error-row:hover {
    background: rgba(248, 113, 113, 0.12);
}

form .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.2rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(6, 57, 113, 0.2);
    background: #fff;
    font-family: inherit;
    transition: var(--ns-transition);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--ns-primary);
    box-shadow: 0 0 0 3px rgba(6, 57, 113, 0.18);
    outline: none;
}

.login-landing {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(2rem, 4vw, 3rem);
    align-items: stretch;
    min-height: clamp(520px, 70vh, 760px);
}

.login-hero {
    color: #fff;
    background: linear-gradient(140deg, rgba(6, 57, 113, 0.95) 0%, rgba(6, 57, 113, 0.82) 45%, rgba(6, 57, 113, 0.78) 100%);
    border-radius: calc(var(--ns-radius) + 6px);
    padding: clamp(2rem, 5vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--ns-shadow);
}

.login-hero h1 {
    font-family: "Montserrat", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 3vw, 2.8rem);
    margin-bottom: 1.25rem;
    color: #fff;
}

.login-hero p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    line-height: 1.8;
}

.login-hero .tagline {
    margin-top: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ns-accent);
}

.login-card {
    border-radius: var(--ns-radius);
    padding: clamp(1.75rem, 2.5vw, 2.25rem);
    background: var(--ns-surface-alt);
    box-shadow: var(--ns-shadow);
    border: 1px solid var(--ns-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card h2 {
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ns-primary);
}

.login-card button {
    margin-top: 0.25rem;
}

.assessment-wrapper {
    display: grid;
    gap: 1.75rem;
}

.assessment-question {
    border-radius: var(--ns-radius);
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(6, 57, 113, 0.18);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.assessment-question h3 {
    margin-bottom: 0.65rem;
    color: var(--ns-primary);
    font-size: 1.1rem;
}

.assessment-question .options {
    display: grid;
    gap: 0.6rem;
}

.option-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(6, 57, 113, 0.22);
    background: rgba(6, 57, 113, 0.04);
    cursor: pointer;
    transition: var(--ns-transition);
}

.option-pill:hover {
    border-color: var(--ns-primary);
    background: rgba(6, 57, 113, 0.1);
}

.option-pill input {
    transform: scale(1.1);
}

.assessment-footer {
    position: sticky;
    bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    padding: 1rem 1.5rem;
    border-radius: calc(var(--ns-radius) + 4px);
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(10px);
    margin-top: 2rem;
}

.assessment-timer {
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.assessment-result-card {
    display: grid;
    gap: 1.2rem;
}

.result-breakdown {
    margin-top: 2rem;
    display: grid;
    gap: 1.2rem;
}

.result-breakdown .question-result {
    border-radius: var(--ns-radius);
    border: 1px solid rgba(6, 57, 113, 0.16);
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    padding: 1.25rem 1.5rem;
}

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.question-explanation {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(6, 57, 113, 0.05);
}

.filters-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
    align-items: end;
}

.filters-bar .wide {
    grid-column: span 2;
}

.course-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.course-card .course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    font-size: 0.86rem;
    color: var(--ns-muted);
}

.progress-track {
    background: rgba(6, 57, 113, 0.12);
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
}

.progress-track span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--ns-accent);
    transition: width 0.4s ease;
}

.footer {
    text-align: center;
    padding: 2rem 1rem 2.5rem;
    color: var(--ns-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .top-bar-inner {
        padding: 0.9rem 1.25rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .assessment-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .filters-bar .wide {
        grid-column: span 1;
    }
}

.card-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.calculator {
    display: grid;
    gap: 0.5rem;
}

.calculator-display {
    font-size: 1.5rem;
    padding: 0.5rem;
    text-align: right;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.calculator-buttons button,
.calculator-clear {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    font-size: 1rem;
    cursor: pointer;
}

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .card-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .card-body.layout-text_image {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}
