/* ==========================================================================
   EduSphere Portal — Design System
   Signature: a circular seal mark, echoing a school crest / report-card
   stamp, used consistently as the brand anchor. Structure borrows from a
   school register: hairline rules and labeled sections, not shadow-cards.
   ========================================================================== */

:root {
    --es-ink: #1b2a4a;
    --es-ink-soft: #2c3e63;
    --es-paper: #f7f7f4;
    --es-paper-raised: #ffffff;
    --es-ochre: #c99a3b;
    --es-ochre-dark: #a97e28;
    --es-slate: #5b6472;
    --es-slate-light: #8b93a0;
    --es-teal: #1f5f5b;
    --es-teal-tint: #e7f1f0;
    --es-clay: #b23a2e;
    --es-clay-tint: #fbeae8;
    --es-line: #dcdcd6;
    --es-line-soft: #eaeae5;
    --es-radius: 6px;
    --es-shadow: 0 1px 2px rgba(27, 42, 74, 0.06), 0 8px 24px rgba(27, 42, 74, 0.06);
    --es-font-display: 'Fraunces', Georgia, serif;
    --es-font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --es-font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
}

.edusphere-portal * {
    box-sizing: border-box;
}

.edusphere-portal {
    font-family: var(--es-font-body);
    color: var(--es-ink);
    line-height: 1.5;
}

.edusphere-portal h1,
.edusphere-portal h2,
.edusphere-portal h3 {
    font-family: var(--es-font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.5em;
    color: var(--es-ink);
}

.edusphere-portal a {
    color: var(--es-teal);
    text-decoration: none;
}

.edusphere-portal a:hover {
    text-decoration: underline;
}

.edusphere-portal a:focus-visible,
.edusphere-portal button:focus-visible,
.edusphere-portal input:focus-visible,
.edusphere-portal select:focus-visible {
    outline: 2px solid var(--es-ochre);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .edusphere-portal * {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- The Seal (signature element) ---------- */

.es-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid currentColor;
    position: relative;
    flex-shrink: 0;
}

.es-seal::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid currentColor;
    border-radius: 50%;
    opacity: 0.5;
}

.es-seal span {
    font-family: var(--es-font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
}

/* ---------- Auth screens (login / password reset) ---------- */

.es-auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--es-paper);
}

@media (min-width: 900px) {
    .es-auth-shell {
        grid-template-columns: 5fr 6fr;
    }
}

.es-auth-brand {
    background: var(--es-ink);
    color: var(--es-paper);
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.es-auth-brand::after {
    content: '';
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    border: 1px solid rgba(247, 247, 244, 0.08);
    right: -180px;
    bottom: -180px;
}

.es-auth-brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--es-ochre);
}

.es-auth-brand-top strong {
    font-family: var(--es-font-display);
    font-size: 20px;
    color: var(--es-paper);
}

.es-auth-brand-mid {
    max-width: 380px;
    margin-top: auto;
    margin-bottom: auto;
    position: relative;
    z-index: 1;
}

.es-auth-brand-mid h1 {
    color: var(--es-paper);
    font-size: 32px;
    line-height: 1.15;
}

.es-auth-brand-mid p {
    color: rgba(247, 247, 244, 0.72);
    font-size: 15px;
}

.es-auth-brand-foot {
    font-size: 12px;
    color: rgba(247, 247, 244, 0.5);
    position: relative;
    z-index: 1;
}

.es-auth-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.es-auth-form {
    width: 100%;
    max-width: 380px;
}

.es-auth-form h2 {
    font-size: 26px;
    margin-bottom: 6px;
}

.es-auth-form > p.es-lede {
    color: var(--es-slate);
    font-size: 14px;
    margin-bottom: 28px;
}

/* ---------- Form primitives ---------- */

.es-field {
    margin-bottom: 18px;
}

.es-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--es-slate);
    margin-bottom: 6px;
}

.es-field input[type="text"],
.es-field input[type="email"],
.es-field input[type="password"],
.es-field input[type="tel"] {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--es-font-body);
    font-size: 15px;
    color: var(--es-ink);
    background: var(--es-paper-raised);
    border: 1px solid var(--es-line);
    border-radius: var(--es-radius);
    transition: border-color 0.15s ease;
}

.es-field input:focus {
    border-color: var(--es-ochre);
}

.es-field .es-hint {
    font-size: 12px;
    color: var(--es-slate-light);
    margin-top: 6px;
}

.es-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    font-family: var(--es-font-body);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--es-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.es-btn:active {
    transform: translateY(1px);
}

.es-btn-primary {
    background: var(--es-ink);
    color: var(--es-paper);
}

.es-btn-primary:hover {
    background: var(--es-ink-soft);
    text-decoration: none;
    color: var(--es-paper);
}

.es-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.es-auth-links {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-top: 20px;
}

.es-alert {
    padding: 12px 14px;
    border-radius: var(--es-radius);
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.es-alert-error {
    background: var(--es-clay-tint);
    border-color: rgba(178, 58, 46, 0.25);
    color: var(--es-clay);
}

.es-alert-success {
    background: var(--es-teal-tint);
    border-color: rgba(31, 95, 91, 0.25);
    color: var(--es-teal);
}

/* ---------- Dashboard shell ---------- */

.es-dash-shell {
    min-height: 100vh;
    background: var(--es-paper);
}

.es-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 28px;
    background: var(--es-paper-raised);
    border-bottom: 1px solid var(--es-line);
    flex-wrap: wrap;
}

.es-dash-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.es-dash-header-left .es-seal {
    width: 40px;
    height: 40px;
    color: var(--es-ink);
}

.es-dash-header-left .es-seal span {
    font-size: 14px;
}

.es-dash-title {
    font-family: var(--es-font-display);
    font-size: 18px;
    color: var(--es-ink);
}

.es-dash-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.es-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.es-badge-role {
    background: var(--es-teal-tint);
    color: var(--es-teal);
}

.es-dash-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 28px 64px;
}

.es-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--es-slate-light);
    margin-bottom: 6px;
}

.es-section {
    margin-bottom: 40px;
}

.es-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--es-line);
    padding-bottom: 10px;
    margin-bottom: 18px;
}

.es-section-head h2 {
    font-size: 20px;
    margin-bottom: 0;
}

.es-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1px;
    background: var(--es-line-soft);
    border: 1px solid var(--es-line-soft);
}

.es-grid-item {
    background: var(--es-paper-raised);
    padding: 20px;
}

.es-grid-item h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.es-grid-item p {
    font-size: 13px;
    color: var(--es-slate);
    margin: 0;
}

.es-register-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--es-line-soft);
    font-size: 14px;
}

.es-register-row:last-child {
    border-bottom: none;
}

.es-register-row .es-register-label {
    color: var(--es-slate);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.es-coming-soon {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--es-line-soft);
    color: var(--es-slate);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.es-empty-state {
    padding: 32px;
    text-align: center;
    color: var(--es-slate);
    border: 1px dashed var(--es-line);
    border-radius: var(--es-radius);
    font-size: 14px;
}
