﻿/* ---------- Device pairing panel (tablet) ---------- */
/* Full-screen takeover on the brand's deep-teal field. Contents are built by
   js/authorized.js -> buildPairPanel(). */
.code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    position: fixed;
    top:0;
    left:0;
    z-index: 999;
    background-color: #122f38;
}

.pair-card {
    background-color: #00808e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    font-family: sans-serif;
    min-width: min(90vw, 30rem);
}

/* Carries the "what is this number" job on its own now that the instruction line is gone, so it's
   sized as a heading rather than a caption. */
.pair-label {
    color: var(--yellow);
    font-size: 1.5rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Sized to be read from across a classroom; tabular figures so rotation doesn't reflow the digits. */
.pair-code {
    color: #ffffff;
    font-size: min(22vw, 8rem);
    font-weight: bold;
    line-height: 1.05;
    letter-spacing: 0.14em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* A code that replaced another animates in, so whoever is glancing over sees it moved. */
.pair-code-new {
    animation: pair-code-in 500ms ease-out;
}

@keyframes pair-code-in {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .pair-code-new {
        animation: none;
    }
}

/* Drains over the current code's lifetime. Paired with the text countdown below -- never the only
   signal, since a drained bar alone reads as "broken". */
.pair-meter {
    height: 6px;
    width: 100%;
    margin: 1.5rem 0 0.6rem 0;
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    overflow: hidden;
}

.pair-meter-fill {
    height: 100%;
    width: 100%;
    background-color: var(--yellow);
    border-radius: 3px;
    transition: width 1s linear;
}

.pair-timer {
    color: #d6f0f3;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

/* Shown only while the server still accepts the number we just rotated away from. */
.pair-grace {
    color: var(--yellow);
    font-size: 0.95rem;
    margin-top: 0.6rem;
    font-variant-numeric: tabular-nums;
}

/* Empty while waiting -- it only carries what the screen can't imply (offline, needs updating). */
.pair-status {
    color: #d6f0f3;
    font-size: 1.15rem;
    line-height: 1.4;
    margin-top: 1.25rem;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}

/* Collapse rather than reserve the line, so the waiting state doesn't end in a blank strip. The card
   grows when a message does appear, which reads fine -- it's centred in the viewport, so it grows
   evenly rather than shifting the code. */
.pair-status:empty {
    display: none;
}

.pair-status-offline {
    color: #ffcabf;
}

.pair-approved {
    color: #7ac448;
    font-size: min(22vw, 8rem);
    line-height: 1.05;
}

/* ---------- Login sign-in "gateway" ---------- */
/* Deliberately NOT the security-code card: a full-screen branded front door on a
   deep-teal field, so signing in never reads as approving a device. The .login-*
   classes are shared by the index/facilitator/volunteer login and the admin login. */
.da-f-code {
    width: 100%;
    text-align: center;
    background-color: #122f38;
    min-height: calc(100vh - 100px); /* fill the viewport below the 100px .da-top banner */
    padding: 8vh 1rem 3rem 1rem;
    box-sizing: border-box;
}

/* Admin has no top banner; its body is already #122f38, so this reads full-screen. */
#admin-login,
#admin-disabled {
    text-align: center;
    background-color: #122f38;
    min-height: calc(100vh - 4rem); /* .admin-wrapper adds 2rem top + bottom margin */
    padding: 8vh 1rem 3rem 1rem;
    box-sizing: border-box;
}

.login-card {
    max-width: 380px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

/* Product identity above the sign-in -- absent from the device-approval card. */
.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.login-brand-name {
    color: #d6f0f3;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem auto;
    background-color: transparent;
    border: 2px solid var(--yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    /* Recolor the glyph to the ring color; overrides the inline stroke="#10565e". */
    .login-icon svg {
        stroke: var(--yellow);
    }

.login-card h2 {
    color: var(--yellow);
    margin: 0 0 0.5rem 0;
    font-size: 1.6rem;
}

.login-help {
    color: #d6f0f3;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0 auto 1.5rem auto;
    max-width: 320px;
}

.login-code-input {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.5rem;
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background-color: #0a3d44;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    margin-bottom: 1.25rem;
    transition: border-color 0.15s ease;
}

    .login-code-input::placeholder {
        color: rgba(255, 255, 255, 0.3);
        letter-spacing: 0.5rem;
    }

    .login-code-input:focus {
        outline: none;
        border-color: var(--yellow);
    }

.login-submit-btn {
    width: 100%;
    background-color: #7ac448;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0.9rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .login-submit-btn:hover {
        background-color: #6ab038;
    }

    .login-submit-btn:active {
        background-color: #3f6525;
    }

.login-error {
    color: #ffcabf;
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 1.25rem auto 0 auto;
    max-width: 320px;
}

.login-advanced-toggle {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

    .login-advanced-toggle a {
        color: #d6f0f3;
        text-decoration: underline;
    }

.login-advanced {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.login-instance-input {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 1.05rem;
    padding: 0.7rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background-color: #0a3d44;
    color: #ffffff;
    margin-bottom: 1rem;
    transition: border-color 0.15s ease;
}

    .login-instance-input::placeholder {
        color: rgba(255, 255, 255, 0.3);
    }

    .login-instance-input:focus {
        outline: none;
        border-color: var(--yellow);
    }

/* ---------- Security code card (shared by the installation home page and the manage panels) ---------- */
.security-card {
    max-width: 440px;
    margin: 2rem auto;
    background-color: #00808e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 2.5rem 2.5rem 2.25rem 2.5rem;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.security-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem auto;
    background-color: var(--yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.security-card h2 {
    color: var(--yellow);
    margin: 0 0 0.5rem 0;
    font-size: 1.6rem;
}

.security-help {
    color: #d6f0f3;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0 auto 1.5rem auto;
    max-width: 320px;
}

#approved-code {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.5rem;
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background-color: #0a3d44;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    margin-bottom: 1.25rem;
    transition: border-color 0.15s ease;
}

    #approved-code::placeholder {
        color: rgba(255, 255, 255, 0.3);
        letter-spacing: 0.5rem;
    }

    #approved-code:focus {
        outline: none;
        border-color: var(--yellow);
    }

.security-approve-btn {
    width: 100%;
    background-color: #7ac448;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0.9rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .security-approve-btn:hover {
        background-color: #6ab038;
    }

    .security-approve-btn:active {
        background-color: #3f6525;
    }

/* Destructive variant: signs out every tablet in the room, so it reads as caution, not "go". */
.security-reset-btn {
    width: 100%;
    background-color: #c0563a;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0.9rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .security-reset-btn:hover {
        background-color: #a8492f;
    }

    .security-reset-btn:active {
        background-color: #843824;
    }
