/*
 * EMS Staff Unlock PIN barrier.
 *
 * Uses an application keypad so iPad Safari does not open the full software
 * keyboard. The overlay remains above all single-frame Mission Data content.
 */

.ems-staff-pin-overlay[hidden] {
    display: none !important;
}

.ems-staff-pin-overlay {
    position: fixed;
    z-index: 30000;
    inset: 0;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding:
        calc(12px + env(safe-area-inset-top, 0px))
        calc(12px + env(safe-area-inset-right, 0px))
        calc(12px + env(safe-area-inset-bottom, 0px))
        calc(12px + env(safe-area-inset-left, 0px));
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

body.ems-staff-pin-open {
    overflow: hidden !important;
}

.ems-staff-pin-dialog {
    box-sizing: border-box;
    width: min(92vw, 380px);
    max-height: min(94vh, 620px);
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--panel-border, #555);
    border-radius: 10px;
    background: var(--panel-bg, #202020);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.65);
}

.ems-staff-pin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.ems-staff-pin-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.ems-staff-pin-close {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    font-size: 1.55rem;
    line-height: 1;
}

.ems-staff-pin-message {
    min-height: 2.4em;
    margin: 0 0 8px;
    color: var(--text, #f2f2f2);
    font-size: 0.86rem;
    line-height: 1.25;
    text-align: center;
}

.ems-staff-pin-message[data-state="error"] {
    color: var(--warning, #f0bd5b);
    font-weight: 700;
}

.ems-staff-pin-display {
    display: grid;
    place-items: center;
    min-height: 62px;
    margin-bottom: 9px;
    border: 1px solid var(--panel-border, #555);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.3);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.24em;
}

.ems-staff-pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.ems-staff-pin-keypad button {
    min-height: 52px;
    padding: 4px;
    border-radius: 7px;
    font-size: 1.2rem;
    font-weight: 700;
    touch-action: manipulation;
}

.ems-staff-pin-keypad .pin-secondary {
    font-size: 0.88rem;
}

.ems-staff-pin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 9px;
}

.ems-staff-pin-actions button {
    min-height: 44px;
    padding: 5px 8px;
    font-size: 0.88rem;
    font-weight: 700;
}

.ems-staff-pin-actions .pin-primary {
    background: var(--success, #2d8a52);
}

.ems-staff-pin-actions .pin-primary:disabled {
    opacity: 0.6;
}

@media (orientation: landscape) and (max-height: 760px) {
    .ems-staff-pin-dialog {
        width: min(88vw, 500px);
        max-height: 96vh;
        padding: 8px;
    }

    .ems-staff-pin-header {
        margin-bottom: 4px;
    }

    .ems-staff-pin-message {
        min-height: 1.4em;
        margin-bottom: 5px;
    }

    .ems-staff-pin-display {
        min-height: 42px;
        margin-bottom: 5px;
        font-size: 1.45rem;
    }

    .ems-staff-pin-keypad {
        gap: 4px;
    }

    .ems-staff-pin-keypad button {
        min-height: 38px;
    }

    .ems-staff-pin-actions {
        margin-top: 5px;
    }

    .ems-staff-pin-actions button {
        min-height: 38px;
    }
}
/*
 * Pledged row action remains clickable only for PIN-protected row unlock.
 * All pilot data inputs and selects remain disabled until PIN verification.
 */

.signup-table tr.row-pledged .pledge-row-btn.pledged-unlock-btn {
    cursor: pointer;
    opacity: 1;
    white-space: normal;
    font-size: 0.7rem;
    line-height: 1.05;
}

.signup-table tr.row-pledged .pledge-row-btn.pledged-unlock-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.signup-table tr.row-pledged
    input:disabled,
.signup-table tr.row-pledged
    select:disabled {
    cursor: not-allowed;
}
