/* v5.1.2 - Scanner/Global Styles - PROTECTED */
:root {
    --primary-color: #00F0FF;
    --secondary-color: #7000FF;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --success-color: #00ff9d;
    --danger-color: #ff0055;
    --input-bg: rgba(15, 23, 42, 0.6);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 40px;
    position: relative;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
}

.screen.active {
    display: flex;
    opacity: 1;
}

.header {
    text-align: center;
    margin-bottom: 25px;
}

.logo-header-replacement {
    height: 63px;
    width: auto;
    display: block;
    margin: 0 auto;
    max-width: 80%;
}

.scanner-container {
    height: 380px;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #000;
    box-shadow: 0 0 0 1px var(--border-color);
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.scanner-frame {
    width: 250px;
    height: 250px;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2), inset 0 0 20px rgba(0, 240, 255, 0.2);
    position: relative;
}

.scanner-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    animation: scanRay 2s infinite ease-in-out;
}

@keyframes scanRay {
    0% {
        top: 10%;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        top: 90%;
        opacity: 0;
    }
}

.scanner-hint {
    color: white;
    margin-top: 20px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: white;
}

.btn-scanning {
    animation: pulseScan 1.5s infinite ease-in-out;
}

@keyframes pulseScan {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 240, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 240, 255, 0);
    }
}

/* Keyboard and PIN styles moved to auth_v1.css */

/* === SCREEN 1 FIXES === */

/* Hide native iOS/Android video play button */
#video::-webkit-media-controls-start-playback-button,
#video::-webkit-media-controls-play-button,
#video::-webkit-media-controls {
    display: none !important;
    -webkit-appearance: none;
    appearance: none;
}

/* Push scan button to the very bottom for thumb reach */
.bottom-container {
    position: fixed;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    padding: 10px 20px 36px 20px;
    background: linear-gradient(to top, #0f172a 60%, transparent);
    z-index: 50;
    box-sizing: border-box;
}

#screen-scanner .btn-primary {
    width: 100%;
    border-radius: 14px;
    padding: 18px;
    font-size: 16px;
    display: block;
}

/* Transparent overlay to block native iOS play icon */
.video-block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    background: transparent;
    pointer-events: none;
}

/* === SCREEN 2: Reduce top padding since header is removed === */
#screen-auth {
    padding-top: 20px;
}

.version-badge {
    position: fixed;
    bottom: 5px;
    right: 5px;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1000;
}