body.c2fa-body {
    background: linear-gradient(135deg, #0f172a, #1e293b) !important;
}

/* Force full-page takeover */
#main-body, .main-content, .container {
    background: transparent !important;
}

/* Center container properly */
.c2fa-container {
    display: flex;
    align-items: flex-start; /* was center ❌ */
    justify-content: center;
    gap: 20px;
    min-height: 70vh;
    flex-wrap: wrap; /* 🔥 critical fix */
}

/* Glass card */
.c2fa-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 30px;
    width: 420px;
    color: #f1f5f9;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* Headings */
.c2fa-card h2 {
    color: #ffffff;
    margin-bottom: 20px;
}

/* Labels */
.c2fa-card label {
    color: #cbd5f5;
    font-size: 14px;
}

/* Inputs */
.c2fa-input,
select.c2fa-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #fff;
    margin-top: 5px;
    margin-bottom: 15px;
}

/* Fix dropdown arrow + appearance */
select.c2fa-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

/* Optional: custom arrow (nice polish) */
select.c2fa-input {
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='20' viewBox='0 0 20 20' width='20'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

/* Fix dropdown option colors (important) */
select.c2fa-input option {
    background: #1a1a1a;
    color: #fff;
}

/* Fix invisible text when typing */
.c2fa-input::placeholder {
    color: rgba(255,255,255,0.5);
}

/* Button */
.c2fa-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.c2fa-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(37,99,235,0.4);
}

/* Alert */
.c2fa-alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Divider */
.c2fa-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 20px 0;
}

/* Small text */
.c2fa-muted {
    font-size: 13px;
    color: #94a3b8;
}

/* Shake animation */
@keyframes c2faShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.c2fa-shake {
    animation: c2faShake 0.4s;
    border: 1px solid #ef4444 !important;
}

/* Success state */
body.c2fa-success .c2fa-card {
    box-shadow: 0 0 40px rgba(34,197,94,0.6);
    border: 1px solid rgba(34,197,94,0.5);
}

/* hide whmcs 2 step */
.twofa-config-link,
.open-modal.twofa-config-link {
    display: none !important;
}


/* ============================= */
/* DEVICE UI */
/* ============================= */

.c2fa-device {
    padding:12px;
    border:1px solid rgba(255,255,255,0.08);
    border-radius:10px;
    margin-bottom:10px;
    background: rgba(255,255,255,0.02);
}

.c2fa-device-top {
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.c2fa-device-name {
    font-weight:600;
    font-size:14px;
}

.c2fa-device-meta {
    font-size:12px;
    opacity:0.7;
}

.c2fa-device-time {
    font-size:11px;
    text-align:right;
    opacity:0.6;
}

.c2fa-device-bottom {
    margin-top:10px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.c2fa-device-stats {
    font-size:12px;
    opacity:0.8;
}

/* Button variants */
.c2fa-btn-danger {
    background: linear-gradient(135deg, #ff4d4d, #ff1a1a);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.c2fa-btn-danger:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 0 12px rgba(255,0,0,0.6);
}

#c2faMap {
    flex: 1;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.leaflet-container {
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px;
}

/* MAP CARD FIX */
.c2fa-map-card {
    height: 320px;
    display: flex;
    flex-direction: column;
}

/* FIX MAP SIZE PROPERLY */
.c2fa-map-card #c2faMap {
    width: 100%;
    height: 260px;
    margin-top: 10px;
    border-radius: 8px;
}

/* ENSURE LEAFLET FILLS */
.c2fa-map-card .leaflet-container {
    width: 100% !important;
    height: 100% !important;
}

.c2fa-side {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ============================= */
/* MOBILE FIX (FINAL CLEAN) */
/* ============================= */

@media (max-width: 768px) {

    /* Main layout */
    .c2fa-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
        padding: 10px;
    }

    /* Cards full width */
    .c2fa-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 18px;
        border-radius: 12px;
    }

    /* Fix right column wrapper */
    .c2fa-container > div:last-child {
        width: 100% !important;
        min-width: 100% !important;
    }

    /* Buttons stack nicely */
    .c2fa-card a.c2fa-btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }

    /* Trusted device layout */
    .c2fa-device-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .c2fa-device-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .c2fa-device-time {
        text-align: left;
    }

    /* Map card fix */
    .c2fa-map-card {
        width: 100% !important;
    }

    #c2faMap {
        height: 220px !important;
    }
    
    .c2fa-side {
        width: 100%;
        min-width: 100%;
    }
    
    body.c2fa-body {
        padding-bottom: 30px;
    }

    .c2fa-card h2 {
        font-size: 20px;
    }

    .c2fa-card h4 {
        font-size: 16px;
    }

}