:root {
    --upfim-green: #006140;
    --upfim-green-dark: #003f2d;
    --upfim-gold: #b99a55;
    --ink: #1f2933;
    --muted: #65717d;
    --line: #dbe4df;
    --surface: #ffffff;
    --soft: #f3f7f5;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(0, 97, 64, .91), rgba(31, 41, 51, .84)),
        url("https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
    color: var(--ink);
}

a {
    color: var(--upfim-green);
}

.topbar {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid rgba(255, 255, 255, .58);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .12);
}

.topbar small {
    color: var(--muted);
}

.brand-mark {
    width: 54px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #fff;
}

.brand-mark img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.login-shell {
    width: min(1120px, calc(100% - 32px));
    min-height: calc(100vh - 164px);
    margin: 0 auto;
    padding: 54px 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, .75fr);
    gap: 42px;
    align-items: center;
}

.hero-copy {
    color: #fff;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--upfim-gold);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-copy h1,
.page-heading h1 {
    margin: 0;
    font-weight: 800;
    line-height: 1.05;
}

.hero-copy h1 {
    max-width: 760px;
    font-size: clamp(2.4rem, 5vw, 4.9rem);
}

.hero-copy p {
    max-width: 640px;
    margin: 22px 0;
    color: rgba(255, 255, 255, .88);
    font-size: 1.18rem;
}

.info-strip,
.support-box,
.instructions {
    border-left: 4px solid var(--upfim-gold);
    border-radius: 8px;
}

.info-strip {
    width: min(560px, 100%);
    padding: 16px 18px;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
}

.info-strip span,
.support-box,
.muted,
.panel-title p,
.page-heading p,
.student-strip span,
.summary-grid span {
    color: var(--muted);
}

.auth-card,
.panel {
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .2);
}

.auth-card {
    padding: clamp(24px, 4vw, 42px);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.brand-lockup img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.brand-lockup span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
}

.brand-lockup strong {
    display: block;
    font-size: 1.05rem;
}

.auth-card h2,
.panel h2 {
    margin: 0 0 4px;
    font-weight: 800;
}

.form-control,
.form-select,
.btn {
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--upfim-green);
    box-shadow: 0 0 0 .25rem rgba(0, 97, 64, .16);
}

.btn-upfim {
    background: var(--upfim-green);
    border-color: var(--upfim-green);
    color: #fff;
    font-weight: 700;
}

.btn-upfim:hover,
.btn-upfim:focus {
    background: var(--upfim-green-dark);
    border-color: var(--upfim-green-dark);
    color: #fff;
}

.support-box {
    margin-top: 24px;
    padding: 14px 16px;
    background: var(--soft);
    font-size: .94rem;
}

.page-heading {
    margin-bottom: 24px;
    padding: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.page-heading h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

.page-heading p {
    max-width: 680px;
    margin: 10px 0 0;
    font-size: 1.05rem;
}

.panel {
    padding: clamp(20px, 3vw, 34px);
}

.panel-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.student-strip,
.summary-grid {
    display: grid;
    gap: 12px;
}

.student-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 28px;
}

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

.student-strip div,
.summary-grid div {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.student-strip span,
.summary-grid span {
    display: block;
    margin-bottom: 4px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.student-strip strong,
.summary-grid strong {
    display: block;
    overflow-wrap: anywhere;
}

.instructions {
    margin-bottom: 22px;
    padding: 16px 18px;
    background: #fbfaf5;
}

.instructions ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.registration-form {
    margin-top: 8px;
}

.site-footer {
    padding: 18px 0;
    background: rgba(255, 255, 255, .94);
    color: var(--muted);
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-footer strong,
.site-footer span {
    display: block;
}

.print-card {
    max-width: 920px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 42px);
    border-radius: 8px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .18);
}

.print-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.print-head h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    font-weight: 800;
}

.print-head p {
    margin: 8px 0 0;
    color: var(--muted);
}

.print-head img {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
}

.carnet-panel h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    font-weight: 800;
}

.pdf-frame {
    display: block;
    width: 100%;
    height: min(82vh, 980px);
    min-height: 760px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf8;
}

.pdf-fallback {
    height: 100%;
    min-height: 560px;
    display: grid;
    place-items: center;
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 991.98px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .student-strip,
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        align-items: flex-start !important;
    }

    .topbar .container,
    .site-footer .container,
    .page-heading,
    .panel-title {
        align-items: stretch;
        flex-direction: column;
    }

    .login-shell {
        width: min(100% - 20px, 1120px);
        padding: 26px 0;
    }

    .auth-card,
    .panel,
    .page-heading {
        padding: 20px;
    }

    .pdf-frame {
        min-height: 520px;
    }

    .hero-copy h1 {
        font-size: 2.25rem;
    }

    .student-strip,
    .summary-grid {
        grid-template-columns: 1fr;
    }

}

@media print {
    body {
        background: #fff;
    }

    .topbar,
    .site-footer,
    .print-actions {
        display: none !important;
    }

    .print-card {
        box-shadow: none;
        padding: 0;
    }
}
