/* ChainBETs Codex Audio Auth Gate */

.cb-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0A0F0D;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

.cb-gate.hidden {
    display: none;
}

/* Animated background grid */
.cb-gate::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(93, 190, 93, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(93, 190, 93, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gateGridPulse 8s ease-in-out infinite;
}

@keyframes gateGridPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Radial glow behind card */
.cb-gate::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(93, 190, 93, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.cb-gate-card {
    position: relative;
    z-index: 1;
    width: 440px;
    max-width: calc(100vw - 2rem);
    background: linear-gradient(145deg, #111916 0%, #0A0F0D 100%);
    border: 1px solid #1a2e1a;
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 80px rgba(93, 190, 93, 0.05);
}

/* Logo */
.cb-gate-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cb-gate-logo .icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #5DBE5D, #D4A528);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 900;
    color: #0A0F0D;
}

.cb-gate-logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #e5e7eb;
    margin: 0;
    letter-spacing: -0.02em;
}

.cb-gate-subtitle {
    text-align: center;
    font-size: 0.8125rem;
    color: #5DBE5D;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Upload zone */
.cb-gate-upload {
    border: 2px dashed #1a2e1a;
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(17, 25, 22, 0.5);
    position: relative;
    overflow: hidden;
}

.cb-gate-upload:hover,
.cb-gate-upload.dragover {
    border-color: #5DBE5D;
    background: rgba(93, 190, 93, 0.05);
}

.cb-gate-upload.dragover {
    box-shadow: inset 0 0 30px rgba(93, 190, 93, 0.1);
}

.cb-gate-upload .upload-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: rgba(93, 190, 93, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-gate-upload .upload-icon svg {
    width: 28px;
    height: 28px;
    fill: #5DBE5D;
}

.cb-gate-upload h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #d1d5db;
    margin: 0 0 0.375rem;
}

.cb-gate-upload p {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.cb-gate-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Status */
.cb-gate-status {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cb-gate-status.visible {
    display: flex;
}

.cb-gate-status.processing {
    background: rgba(93, 190, 93, 0.08);
    border: 1px solid rgba(93, 190, 93, 0.2);
    color: #5DBE5D;
}

.cb-gate-status.success {
    background: rgba(93, 190, 93, 0.12);
    border: 1px solid rgba(93, 190, 93, 0.3);
    color: #5DBE5D;
}

.cb-gate-status.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Spinner */
.cb-gate-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(93, 190, 93, 0.3);
    border-top-color: #5DBE5D;
    border-radius: 50%;
    animation: gateSpin 0.8s linear infinite;
}

@keyframes gateSpin {
    to { transform: rotate(360deg); }
}

/* Divider */
.cb-gate-divider {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid #1a2e1a;
}

/* Footer info */
.cb-gate-footer {
    text-align: center;
    font-size: 0.6875rem;
    color: #4b5563;
    line-height: 1.6;
}

.cb-gate-footer .accent {
    color: #D4A528;
}

/* File info when selected */
.cb-gate-fileinfo {
    display: none;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(93, 190, 93, 0.05);
    border: 1px solid #1a2e1a;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

.cb-gate-fileinfo.visible {
    display: block;
}

.cb-gate-fileinfo .filename {
    color: #d1d5db;
    font-weight: 500;
}

/* Decode button */
.cb-gate-decode-btn {
    display: none;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #5DBE5D, #4da64d);
    border: none;
    border-radius: 0.625rem;
    color: #0A0F0D;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cb-gate-decode-btn.visible {
    display: block;
}

.cb-gate-decode-btn:hover {
    background: linear-gradient(135deg, #6fd06f, #5DBE5D);
    box-shadow: 0 4px 20px rgba(93, 190, 93, 0.3);
}

.cb-gate-decode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Logout button (shown in-app) */
.cb-logout-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    padding: 0.375rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.5rem;
    color: #ef4444;
    font-size: 0.6875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
}

.cb-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.cb-logout-btn.visible {
    display: block;
}

/* Mobile */
@media (max-width: 640px) {
    .cb-gate-card {
        margin: 1rem;
        padding: 2rem 1.25rem;
    }

    .cb-gate-logo h1 {
        font-size: 1.375rem;
    }

    .cb-gate-upload {
        padding: 1.5rem 1rem;
    }
}
