/*
 * auth_gate.css — single source of truth for every staff PIN-entry gate.
 *
 * One consistent, high-contrast LIGHT theme shared by all gates
 * (admin hub, bookings console, validate, QR codes, sales, booking sheets).
 * The gate is a full-screen position:fixed; inset:0 overlay, so this light
 * palette renders correctly even over the dark bookings console.
 *
 * WCAG AA contrast (all on #ffffff card):
 *   heading  #1a202c  ~15.9:1
 *   subtext  #475569  ~7.9:1
 *   button   #ffffff on #534ab7  ~6.4:1
 *   error    #c0392b  ~5.5:1
 *
 * Loaded AFTER style.css (and any page-specific CSS) so it wins on link order.
 * Selectors are scoped to .auth-overlay to beat unscoped rules in style.css.
 */

.auth-overlay {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f6;
    z-index: 2000;
}

.auth-overlay.hidden {
    display: none;
}

.auth-overlay .auth-form-container {
    box-sizing: border-box;
    width: 340px;
    max-width: 90vw;
    margin: 0;
    padding: 32px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(20, 30, 50, 0.10);
}

.auth-overlay .auth-form-container h2 {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
}

.auth-overlay .auth-form-container p,
.auth-overlay .auth-form-container small {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0 0 16px;
}

.auth-overlay .auth-form-container input {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 0.3em;
    color: #1a202c;
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
}

.auth-overlay .auth-form-container input::placeholder {
    color: #94a3b8;
    letter-spacing: normal;
}

.auth-overlay .auth-form-container input:focus {
    outline: none;
    border-color: #534ab7;
    box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.18);
}

.auth-overlay .auth-form-container .btn-primary,
.auth-overlay .auth-form-container .btn.btn-primary {
    display: block;
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #534ab7;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.auth-overlay .auth-form-container .btn-primary:hover,
.auth-overlay .auth-form-container .btn.btn-primary:hover {
    background: #4840a0;
}

.auth-overlay .auth-form-container .btn-primary:disabled,
.auth-overlay .auth-form-container .btn.btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.auth-overlay .auth-error {
    margin-top: 12px;
    padding: 0;
    font-size: 0.9rem;
    color: #c0392b;
    background: none;
    border: none;
    border-radius: 0;
}

.auth-overlay .auth-error.hidden {
    display: none;
}

/* --- Console gate extras: location picker, field labels, night notice --- *
 * Contrast on #ffffff (or the noted background):
 *   label    #475569  ~7.9:1
 *   notice   #7c4a03 on #fff7ed  ~7.3:1
 *   link     #534ab7  ~6.4:1
 */

.auth-overlay .auth-form-container .auth-label {
    display: block;
    margin: 0 0 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    color: #475569;
}

.auth-overlay .auth-form-container .auth-select {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 1rem;
    color: #1a202c;
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
}

.auth-overlay .auth-form-container .auth-select:focus {
    outline: none;
    border-color: #534ab7;
    box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.18);
}

.auth-overlay .auth-form-container .auth-venue {
    font-weight: 700;
    color: #1a202c;
}

.auth-overlay .auth-form-container .auth-notice {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #7c4a03;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
}

.auth-overlay .auth-form-container .auth-linkbtn {
    display: block;
    margin: -4px 0 14px auto;
    padding: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #534ab7;
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

/* Loading state: fields stop accepting input and the button spins. */
.auth-overlay .auth-form-container form.auth-busy input,
.auth-overlay .auth-form-container form.auth-busy .auth-select {
    pointer-events: none;
    opacity: 0.6;
}

.auth-overlay .auth-form-container form.auth-busy .btn-primary::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .auth-overlay .auth-form-container {
        width: 95%;
        padding: 30px 20px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .auth-overlay {
        overflow-y: auto;
    }

    .auth-overlay .auth-form-container {
        margin: 20px auto;
    }
}

/* --- Two-layer console gate: step 2 (personal PIN / session-only name) --- */
.auth-overlay .auth-form-container .auth-step-2.hidden {
    display: none;
}

.auth-overlay .auth-form-container #admin-personal-auth-form.hidden,
.auth-overlay .auth-form-container #admin-auth-no-staff.hidden {
    display: none;
}

.auth-overlay .auth-form-container .auth-notice a {
    display: inline-block;
    margin-top: 6px;
    color: #534ab7;
    font-weight: 600;
}

.auth-overlay .auth-form-container .auth-linkbtn-cancel {
    margin: 14px auto 0;
    text-align: center;
}
