/* =============================================
   PIN ENTRY — 8-character alphanumeric sign-in
   ---------------------------------------------
   The portal's login markup moved from a 4-dot NUMERIC keypad to a single
   8-character TEXT field when PINs became alphanumeric. The upstream rules for
   it live in the Assessment Center's portal-theme-components.css, which this
   dark "Mathematical Vision" portal does not load — so the field is styled here
   instead, and this file is linked AFTER the theme so it wins.

   Every colour carries an explicit fallback. The upstream rules lean on
   --portal-accent-* variables that this theme does not define, and a
   transparent field on a dark page is an invisible field — which is exactly how
   sign-in broke.
   ============================================= */

/* One centred column for the whole PIN step.
   The setup-code block was 280px and left-aligned while the PIN row was a
   240px centred flex row, so on the reset screen the two inputs started at
   different x positions and the block read as ragged. Both are now the same
   width and centred, so their left edges line up. */
.pin-entry-row,
#pin-setup-code-row {
    max-width: 264px !important;   /* beats the inline max-width on the row */
    margin-left: auto;
    margin-right: auto;
}

.pin-entry-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px auto 6px;
}

.pin-entry-input {
    /* Fill the column minus the Show button, instead of a fixed width that
       cannot line up with the setup-code field above it. */
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 14px 16px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 6px;
    text-align: center;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;
    /* Light field on the dark portal: maximum legibility for a credential a
       scholar is typing from memory, and unambiguous about where to type. */
    color: var(--portal-text, #101828);
    background: #ffffff;
    border: 2px solid var(--portal-accent-border, #c6a455);
    border-radius: 12px;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pin-entry-input::placeholder {
    font-size: 14px;
    letter-spacing: 1px;
    font-weight: 500;
    text-transform: none;
    color: #667085;
}

.pin-entry-input:focus {
    outline: none;
    border-color: var(--portal-accent, #dcb14a);
    box-shadow: 0 0 0 3px rgba(220, 177, 74, .35);
}

.pin-entry-input.error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, .3);
}

.pin-entry-reveal {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #f7f1df;
    background: rgba(220, 177, 74, .16);
    border: 1px solid var(--portal-accent-border, #c6a455);
    border-radius: 8px;
    cursor: pointer;
    /* Touch target — scholars sign in on Chromebook trackpads and tablets. */
    min-height: 44px;
    min-width: 56px;
}

.pin-entry-reveal:hover { background: rgba(220, 177, 74, .28); }

.pin-entry-reveal:focus-visible {
    outline: 2px solid var(--portal-accent, #dcb14a);
    outline-offset: 2px;
}

.pin-entry-help {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.45;
    color: #cbd5e1;
    text-align: center;
}

/* The submit button arrived with the new login markup and is styled upstream
   in portal-theme-components.css, which this portal does not load — without
   this it renders as a bare grey browser default on the dark panel. */
.pin-submit-btn {
    display: block;
    margin: 4px auto 0;
    min-width: 200px;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .02em;
    color: #101828;
    background: linear-gradient(135deg, #dcb14a, #c6a455);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: filter .15s ease, transform .05s ease;
}

.pin-submit-btn:hover:not(:disabled) { filter: brightness(1.08); }
.pin-submit-btn:active:not(:disabled) { transform: translateY(1px); }
.pin-submit-btn:disabled { opacity: .5; cursor: not-allowed; }
.pin-submit-btn:focus-visible {
    outline: 2px solid #f7f1df;
    outline-offset: 2px;
}

.pin-confirm-label {
    text-align: center;
    color: #cbd5e1;
    font-size: .9rem;
    margin-top: 1rem;
}

/* Shown only when creating or resetting a PIN. */
.pin-responsibility {
    max-width: 380px;
    margin: 14px auto 0;
    padding: 12px 14px;
    text-align: left;
    background: rgba(220, 177, 74, .10);
    border: 1px solid var(--portal-accent-border, #c6a455);
    border-radius: 10px;
    color: #e8eef7;
}

.pin-responsibility h3 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 800;
    color: var(--portal-accent, #dcb14a);
}

.pin-responsibility ul { margin: 0; padding-left: 18px; }
.pin-responsibility li { font-size: 12px; line-height: 1.5; margin-bottom: 6px; }
.pin-responsibility strong { color: #fff; }

/* The teacher setup-code field ships with inline styles upstream; only its
   surrounding label needs help on a dark background. */
#pin-setup-code-row label { color: #e8eef7 !important; }
#pin-setup-code-help { color: #cbd5e1 !important; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
