* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Fondo animado con formas */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: float 20s infinite ease-in-out;
    opacity: 0.3;
}

.shape:nth-child(1) {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #667eea, #4a5fb8);
    top: -150px;
    left: -150px;
    animation-delay: 0s;
    animation-duration: 25s;
}

.shape:nth-child(2) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #764ba2, #5a3680);
    top: 50%;
    right: -200px;
    animation-delay: 5s;
    animation-duration: 30s;
}

.shape:nth-child(3) {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #667eea, #4a5fb8);
    bottom: -125px;
    left: 30%;
    animation-delay: 10s;
    animation-duration: 20s;
}

.shape:nth-child(4) {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #764ba2, #5a3680);
    top: 20%;
    left: 50%;
    animation-delay: 15s;
    animation-duration: 35s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(100px, -100px) rotate(90deg);
    }
    50% {
        transform: translate(-50px, 100px) rotate(180deg);
    }
    75% {
        transform: translate(-150px, -50px) rotate(270deg);
    }
}

/* Login Page */
.login-container {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3),
                0 0 100px rgba(102, 126, 234, 0.1);
    max-width: 420px;
    width: 100%;
    padding: 50px 40px;
    animation: fadeIn 0.5s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.login-header i {
    font-size: 56px;
    color: #667eea;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
    display: block;
}

.login-header h1 {
    font-size: 32px;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.login-header p {
    color: #aaa;
    font-size: 15px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #ddd;
    font-weight: 500;
    font-size: 14px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    pointer-events: none;
    z-index: 1;
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 13px 15px 13px 50px !important;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: rgba(30, 30, 30, 0.8);
    color: #fff;
}

.form-input::placeholder {
    color: #666;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2),
                0 0 20px rgba(102, 126, 234, 0.3);
    background: rgba(40, 40, 40, 0.9);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
}

.alert.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b7d;
    border: 1px solid rgba(220, 53, 69, 0.5);
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    color: #5dd87f;
    border: 1px solid rgba(40, 167, 69, 0.5);
}

.loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

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

.login-footer {
    text-align: center;
    margin-top: 35px;
    color: #666;
    font-size: 13px;
}

/* Dashboard */
.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
}

.header h1 {
    color: #ffffff;
    font-size: 1.8em;
    margin-bottom: 5px;
}

.header p {
    color: #aaa;
    font-size: 0.95em;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 10px;
}

.status-active {
    background: #10b981;
    color: white;
}

.status-inactive {
    background: #ef4444;
    color: white;
}

.card {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
}

.card h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.add-client-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

input[type="text"], input[type="password"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
    background: rgba(30, 30, 30, 0.8);
    color: #fff;
}

input[type="text"]::placeholder, input[type="password"]::placeholder {
    color: #666;
}

input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(40, 40, 40, 0.9);
}

button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-danger:hover {
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.btn-secondary:hover {
    box-shadow: 0 5px 15px rgba(107, 114, 128, 0.4);
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
}

.clients-table th {
    background: rgba(102, 126, 234, 0.1);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #667eea;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.clients-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    color: #ddd;
}

.clients-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.clients-table code {
    font-family: 'Courier New', monospace;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    color: #667eea;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons button {
    padding: 6px 12px;
    font-size: 0.9em;
}

.logout-btn {
    float: right;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-btn:hover {
    color: #667eea;
}

.qr-container {
    text-align: center;
    margin: 20px 0;
}

.qr-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.qr-container p {
    color: #ddd;
}

.qr-container strong {
    color: #667eea;
}

/* Estilos para modal 2FA */
#twoFactorModal .modal-content {
    background: rgba(20, 20, 20, 0.98);
    color: #fff;
}

#twoFactorModal .qr-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin: 20px auto;
    max-width: 300px;
}

#twoFactorModal .qr-container img {
    border: none;
    background: #fff;
}

#twoFactorModal .qr-container p,
#twoFactorModal .qr-container strong {
    color: #000;
}

#twoFactorModal input[type="text"] {
    width: 100%;
    padding: 12px;
    background: rgba(30, 30, 30, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    letter-spacing: 0.5em;
    font-family: 'Courier New', monospace;
}

#twoFactorModal input[type="text"]::placeholder {
    color: #666;
    letter-spacing: normal;
}

@media (max-width: 768px) {
    .add-client-form {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .clients-table {
        font-size: 0.9em;
    }
    
    .logout-btn {
        float: none;
        width: 100%;
        margin-bottom: 15px;
    }
}

/* Estilos para gráfico de ancho de banda */
#bandwidthChart {
    background: rgba(10, 10, 10, 0.5);
    border-radius: 8px;
    padding: 15px;
}
