@charset "UTF-8";
/* Base document + shared components. Design tokens live in tokens.css --
   nothing in this file should hardcode a color, font, or spacing value. */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    font-weight: var(--fw-regular);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 750;
    letter-spacing: -0.015em;
    color: var(--color-text);
    text-wrap: balance;
}

a { color: var(--color-primary); }

:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ---------- Buttons — a real system: variant x size, real states ---------- */
.btn-ghi-primary, .btn-ghi-accent, .btn-ghi-outline, .btn-ghi-ghost, .btn-ghi-danger {
    font-family: var(--font-ui);
    font-weight: var(--fw-semibold);
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1.5px solid transparent;
    transition: filter var(--duration-fast) linear, transform var(--duration-fast) linear, box-shadow var(--duration-fast) linear, border-color var(--duration-fast) linear, background var(--duration-fast) linear, color var(--duration-fast) linear;
}
.btn-ghi-primary:active, .btn-ghi-accent:active, .btn-ghi-outline:active, .btn-ghi-ghost:active, .btn-ghi-danger:active { transform: translateY(1px); }
.btn-ghi-primary svg, .btn-ghi-accent svg, .btn-ghi-outline svg, .btn-ghi-ghost svg, .btn-ghi-danger svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-ghi-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--color-primary) 65%, transparent);
}
.btn-ghi-primary:hover, .btn-ghi-primary:focus { filter: brightness(1.08); color: #fff; }

.btn-ghi-accent {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-primary-dark);
    box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--color-accent) 55%, transparent);
}
.btn-ghi-accent:hover, .btn-ghi-accent:focus { filter: brightness(1.05); color: var(--color-primary-dark); }

.btn-ghi-outline {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text);
}
.btn-ghi-outline:hover, .btn-ghi-outline:focus { border-color: var(--color-primary); color: var(--color-primary); }

.btn-ghi-ghost {
    background: var(--color-primary-soft);
    border-color: transparent;
    color: var(--color-primary);
}
.btn-ghi-ghost:hover, .btn-ghi-ghost:focus { filter: brightness(0.97); color: var(--color-primary); }

.btn-ghi-danger {
    background: var(--status-danger-bg);
    border-color: transparent;
    color: var(--status-danger-text);
}
.btn-ghi-danger:hover, .btn-ghi-danger:focus { filter: brightness(0.97); color: var(--status-danger-text); }

.btn-ghi-primary.btn-sm, .btn-ghi-accent.btn-sm, .btn-ghi-outline.btn-sm, .btn-ghi-ghost.btn-sm, .btn-ghi-danger.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn-ghi-primary.btn-lg, .btn-ghi-accent.btn-lg, .btn-ghi-outline.btn-lg, .btn-ghi-ghost.btn-lg, .btn-ghi-danger.btn-lg { padding: 0.75rem 1.4rem; font-size: 0.95rem; }
.btn-ghi-primary:disabled, .btn-ghi-accent:disabled, .btn-ghi-outline:disabled, .btn-ghi-ghost:disabled, .btn-ghi-danger:disabled { opacity: 0.45; cursor: not-allowed; filter: none; box-shadow: none; }

/* Bootstrap form controls, retouched to match the token system */
.form-control, .form-select {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
}
.form-control:focus, .form-select:focus {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--color-primary-soft); }
.nav-tabs .nav-link { color: var(--color-text-muted); border: none; font-family: var(--font-ui); font-weight: var(--fw-medium); font-size: var(--text-sm); }
.nav-tabs .nav-link.active { color: var(--color-primary); border-bottom: 2px solid var(--color-primary); background: none; }
.nav-tabs { border-bottom: 1px solid var(--color-border); }

/* ---------- Simple centered auth card (login, forgot/reset password) ---------- */
.ghi-auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    padding: var(--space-6);
}

.ghi-auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-10) var(--space-8);
    width: 100%;
    max-width: 420px;
}

.ghi-auth-card .form-control {
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    font-family: var(--font-body);
}

.ghi-auth-card label { font-family: var(--font-ui); }

.ghi-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
}
.ghi-auth-brand img { width: 56px; height: 56px; border-radius: 50%; margin-bottom: var(--space-2); }
.ghi-auth-brand h1 { font-size: var(--text-xl); margin: 0; }
.ghi-auth-brand p { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }

.ghi-auth-card .form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.ghi-auth-passwrap { position: relative; }
.ghi-auth-passwrap input { padding-right: 2.6rem; }
.ghi-auth-passwrap button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    padding: 0.3rem;
    display: flex;
    cursor: pointer;
}
.ghi-auth-passwrap button svg { width: 18px; height: 18px; }

.ghi-auth-footer {
    text-align: center;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-6);
}
.ghi-auth-footer a { color: var(--color-text-muted); }
.ghi-auth-links {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-3);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
}

/* ---------- Login — split brand/form panel ---------- */
.login-shell {
    min-height: 100vh;
    display: flex;
    background: var(--color-bg);
}
.login-brand {
    width: 44%;
    max-width: 560px;
    background: var(--color-primary-dark);
    color: #fff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-10);
}
.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image: radial-gradient(circle, #fff 1px, transparent 1.6px);
    background-size: 20px 20px;
    pointer-events: none;
}
.login-brand-top, .login-brand-mid, .login-brand-bottom { position: relative; z-index: 1; }
.login-brand-top { display: flex; align-items: center; gap: 10px; font-family: var(--font-ui); font-weight: var(--fw-semibold); font-size: var(--text-lg); }
.login-brand-top img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.login-brand-mid h1 { color: #fff; font-size: var(--text-3xl); font-weight: 800; line-height: 1.2; margin: 0 0 var(--space-3); }
.login-brand-mid p { font-family: var(--font-body); font-size: var(--text-base); color: rgba(255,255,255,0.82); line-height: 1.6; max-width: 26em; margin: 0; }
.login-brand-bottom { font-family: var(--font-ui); font-size: var(--text-xs); color: rgba(255,255,255,0.6); }

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: var(--text-2xl); font-weight: 800; margin: 0 0 4px; }
.login-card .sub { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-text-muted); margin: 0 0 var(--space-6); }

@media (max-width: 860px) {
    .login-shell { flex-direction: column; }
    .login-brand { width: 100%; max-width: none; padding: var(--space-6); }
    .login-brand-mid h1 { font-size: var(--text-2xl); }
    .login-brand-mid p { display: none; }
    .login-form-side { padding: var(--space-6) var(--space-5); }
}

/* ---------- Bookshelf ---------- */
.ghi-book-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
    transition: transform var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
    text-decoration: none;
    color: inherit;
    display: block;
}
.ghi-book-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: inherit;
}
.ghi-book-cover {
    aspect-ratio: 3 / 4;
    background: linear-gradient(160deg, var(--blue-50) 0%, var(--blue-100) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 2rem;
    overflow: hidden;
}
.ghi-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ghi-book-info { padding: var(--space-3) var(--space-4) var(--space-4); }
.ghi-book-title {
    font-family: var(--font-ui);
    font-weight: var(--fw-semibold);
    font-size: 0.95rem;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ghi-book-author {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}
.ghi-category-tag {
    display: inline-block;
    background: var(--blue-50);
    color: var(--color-primary);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: var(--fw-medium);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

/* ---------- Cards / tables (admin) ---------- */
.ghi-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
    border: 1px solid var(--color-border);
}
.table-ghi thead th {
    font-family: var(--font-ui);
    color: var(--color-text-muted);
    font-weight: var(--fw-semibold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom-width: 1px;
}
.badge-published { background: var(--status-good-bg); color: var(--status-good-text); }
.badge-hidden { background: var(--status-neutral-bg); color: var(--status-neutral-text); }
.badge-warn { background: var(--status-warn-bg); color: var(--status-warn-text); }
.badge-info { background: var(--status-info-bg); color: var(--status-info-text); }
.badge-danger { background: var(--status-danger-bg); color: var(--status-danger-text); }

/* ---------- Marks-entry grid (results.php / marks-entry.php) ---------- */
.results-grid-wrap { max-height: 65vh; overflow: auto; }
.results-grid thead th { position: sticky; top: 0; background: var(--color-surface); z-index: 2; white-space: nowrap; }
.results-grid-sticky { position: sticky; left: 0; background: var(--color-surface); z-index: 1; box-shadow: 2px 0 4px rgba(0,0,0,0.04); }
.results-grid thead th.results-grid-sticky { z-index: 3; }
.results-grid .marks-input { min-width: 68px; }
.results-grid .grade-preview { display: block; margin-top: 3px; min-height: 18px; }

/* ---------- Reader ---------- */
.ghi-reader-toolbar {
    background: var(--color-primary-dark);
    color: #fff;
}
.ghi-reader-toolbar .btn { color: #fff; }
#pdf-canvas-wrap {
    background: #525659;
    min-height: calc(100vh - var(--topbar-h));
    display: flex;
    justify-content: center;
    padding: var(--space-5) 0;
    user-select: none;
}
#pdf-canvas-wrap canvas { box-shadow: var(--shadow-lg); }

@media (max-width: 576px) {
    .ghi-auth-card { padding: var(--space-6) var(--space-5); }
}
