:root {
    --ink: #16213E;
    --slate: #5C6B8A;
    --cloud: #F5F7FB;
    --teal: #f5cb60;
    --teal-dark: #eab839;
    --border: #DFE3ED;
    --error: #B42318;
    --error-bg: #FDECEC;
    --error-border: #F5B5B5;
}

* {
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    background: var(--cloud);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--ink);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

#particle-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/*
    * DESKTOP
    * ---------------------------------------------------------
    * The page is divided into exactly two equal columns:
    * 50% PIMIS/Panzi information + 50% login container.
    */
.page-wrap {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: stretch;

    width: 100%;
    min-height: 100vh;

    margin: 0;
    padding: 40px;

    gap: 0;
}

/* =========================
    LEFT — PIMIS / PANZI
    ========================= */

.brand-block {
    width: 50%;
    flex: 0 0 50%;

    min-width: 0;
    min-height: calc(100vh - 80px);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 40px 5vw;

    text-align: center;
}

#pimis_logo_svg {
    width: clamp(230px, 24vw, 380px);
    height: auto;
}

.brand-logo {
    width: 100%;
    max-width: 420px;
    margin-bottom: 18px;
}

.brand-logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.mission-panel {
    flex: 1 1 auto;
    width: 100%;
    max-width: 720px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 30px;
    text-align: center;
    margin-top: 22px;
}

.mission-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--slate);
}

.mission-eyebrow .dot-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
    flex: none;
    animation: pulseDot 2.2s ease-in-out infinite;
}

.mission-pillars {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pillar-chip {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--slate);
    background: transparent;
    transition:
        color 0.4s ease,
        border-color 0.4s ease,
        background 0.4s ease;
}

.pillar-chip.active {
    color: var(--ink);
    border-color: var(--teal);
    background: rgba(245, 203, 96, 0.22);
}

.mission-stage {
    position: relative;
    min-height: 165px;
    text-align: center;
}

.mission-slide {
    position: absolute;
    inset: 0;

    opacity: 0;
    transform: translateY(10px);

    transition:
        opacity 0.6s ease,
        transform 0.6s ease;

    pointer-events: none;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.mission-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mission-headline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.15;
    color: var(--ink);
    margin: 0;
}

.mission-copy {
    font-size: clamp(0.95rem, 1.1vw, 1.08rem);
    line-height: 1.6;
    color: var(--slate);
    max-width: 580px;
    margin: 0;
}

.mission-track {
    width: 70px;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    margin: 2px auto 0;
    overflow: hidden;
}

.mission-track span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--teal);
}

.mission-track span.filling {
    width: 100%;
    transition: width 4.5s linear;
}

.mission-stats {
    display: flex;
    justify-content: center;
    gap: clamp(28px, 4vw, 70px);

    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    color: var(--ink);
}

.stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--slate);
    text-align: center;
}

@keyframes pulseDot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.75);
    }
}

/* =========================
    RIGHT — LOGIN
    ========================= */

.login-card {
    width: 50%;
    flex: 0 0 50%;

    min-height: calc(100vh - 80px);

    display: flex;
    flex-direction: column;
    justify-content: center;

    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;

    padding: clamp(45px, 5vw, 90px) clamp(35px, 5vw, 100px);

    box-shadow:
        0 30px 80px -30px rgba(22, 33, 62, 0.22);
}

h1.headline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    color: var(--ink);
    margin: 4px 0 10px;
    text-align: center;
}

.subline {
    color: var(--slate);
    font-size: clamp(0.94rem, 1vw, 1.08rem);
    line-height: 1.5;
    text-align: center;
    margin: 0 0 clamp(30px, 3vw, 46px);
}

.login-card form {
    width: 100%;
}

.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error);

    border-radius: 10px;
    padding: 13px 15px;
    margin-bottom: 22px;

    font-size: 0.88rem;
    line-height: 1.4;

    animation: shakeIn 0.4s ease;
}

.alert-error svg {
    flex: none;
    margin-top: 1px;
    width: 17px;
    height: 17px;
}

.alert-error ul {
    margin: 0;
    padding-left: 18px;
}

.alert-error p {
    margin: 0;
}

@keyframes shakeIn {
    0% {
        opacity: 0;
        transform: translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: clamp(20px, 2vw, 30px);
}

.form-label {
    display: block;

    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;

    color: var(--slate);
    margin-bottom: 9px;
}

.form-control {
    width: 100%;

    min-height: clamp(50px, 3.5vw, 60px);

    border: 1px solid var(--border);
    border-radius: 11px;

    padding: 14px 16px;

    font-family: 'Inter', sans-serif;
    font-size: clamp(0.96rem, 1vw, 1.08rem);

    color: var(--ink);
    background: var(--cloud);

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--teal);
    background: #fff;

    box-shadow:
        0 0 0 3px rgba(245, 203, 96, 0.25);
}

.form-control.is-invalid {
    border-color: var(--error);
    background: #FDF4F4;
}

.form-control.is-invalid:focus {
    box-shadow:
        0 0 0 3px rgba(180, 35, 24, 0.15);
}

.invalid-feedback {
    display: block;
    color: var(--error);
    font-size: 0.78rem;
    margin-top: 6px;
}

.form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 24px;
    font-size: 0.86rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--slate);
}

.remember-me input {
    accent-color: var(--teal);
    width: 15px;
    height: 15px;
}

.forgot-link {
    color: var(--slate);
    text-decoration: none;
    border-bottom: 1px dashed var(--border);
}

.forgot-link:hover {
    color: var(--ink);
    border-color: var(--slate);
}

.btn-login {
    background: var(--teal);
    border: none;
    color: #fff;

    font-weight: 500;

    min-height: clamp(52px, 3.5vw, 60px);
    padding: 13px;

    border-radius: 11px;
    width: 100%;

    transition:
        background 0.15s ease,
        transform 0.1s ease;

    font-size: clamp(0.98rem, 1vw, 1.08rem);
}

.btn-login:hover,
.btn-login:focus {
    background: var(--teal-dark);
    color: #fff;
}

.btn-login:active {
    transform: translateY(1px);
}

.btn-login:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.btn-login .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
    margin-right: 8px;
    vertical-align: -2px;
}

.footnote {
    text-align: center;
    color: var(--slate);
    font-size: clamp(0.76rem, 0.8vw, 0.86rem);
    line-height: 1.55;
    margin-top: 24px;
    margin-bottom: 0;
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/*
    * TABLET / MOBILE
    * ---------------------------------------------------------
    * The two 50% columns become two 100% sections.
    */
@media (max-width: 820px) {
    body {
        padding: 20px;
        align-items: flex-start;
    }

    .page-wrap {
        width: 100%;
        min-height: auto;

        flex-direction: column;

        padding: 0;
        gap: 28px;
    }

    .brand-block {
        width: 100%;
        flex: 0 0 100%;

        min-height: auto;
        padding: 25px 15px 10px;
    }

    #pimis_logo_svg {
        width: min(70vw, 310px);
    }

    .mission-panel {
        max-width: 100%;
        gap: 24px;
        margin-top: 10px;
    }

    .mission-stage {
        min-height: 175px;
    }

    .mission-copy {
        max-width: 600px;
    }

    .login-card {
        width: 100%;
        flex: 0 0 100%;

        min-height: auto;

        padding: 45px clamp(24px, 7vw, 55px);

        border-radius: 17px;
    }
}

@media (max-width: 560px) {
    body {
        padding: 14px;
    }

    .page-wrap {
        gap: 22px;
    }

    .brand-block {
        padding: 18px 8px 4px;
    }

    .brand-logo {
        margin-bottom: 12px;
    }

    .mission-panel {
        margin-top: 8px;
        gap: 20px;
    }

    .mission-eyebrow {
        font-size: 0.62rem;
    }

    .mission-pillars {
        gap: 6px;
    }

    .pillar-chip {
        font-size: 0.62rem;
        padding: 6px 10px;
    }

    .mission-stage {
        min-height: 190px;
    }

    .mission-headline {
        font-size: 1.65rem;
    }

    .mission-copy {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .mission-stats {
        gap: 18px;
        padding-top: 16px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.58rem;
    }

    .login-card {
        padding: 38px 22px;
    }

    h1.headline {
        font-size: 1.5rem;
    }

    .subline {
        font-size: 0.9rem;
        margin-bottom: 30px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-control {
        min-height: 50px;
    }

    .btn-login {
        min-height: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mission-slide {
        transition: none;
    }

    .mission-track span.filling {
        transition: none;
        width: 100%;
    }

    .btn-login {
        transition: none;
    }

    .spinner-border {
        animation-duration: 1.5s;
    }

    #particle-canvas {
        display: none;
    }

    .alert-error {
        animation: none;
    }
}

#banner_rect {
    transform-box: fill-box;
    transform-origin: center;
    animation: slideIn 0.7s cubic-bezier(.2,.8,.2,1) both;
}

#woman_headers {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
    animation: popIn 0.7s cubic-bezier(.34,1.56,.64,1) 0.35s both;
}

#gear {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
    animation: spinIn 0.9s cubic-bezier(.2,.8,.2,1) 0.15s both;
}

#pimis_chars {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
    animation: popIn 0.6s cubic-bezier(.34,1.56,.64,1) 1.1s both;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spinIn {
    from {
        opacity: 0;
        transform: rotate(-90deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}